本文整理了Java中com.google.gwt.dev.util.Util.getBytes()
方法的一些代码示例,展示了Util.getBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getBytes()
方法的具体详情如下:
包路径:com.google.gwt.dev.util.Util
类名称:Util
方法名:getBytes
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
private String getMd5HashOfData() {
return Util.computeStrongName(Util.getBytes(data.toString()));
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private String computeDefaultPrefix(ResourceContext context) {
SortedSet<JClassType> gssResources = computeOperableTypes(context);
Adler32 checksum = new Adler32();
for (JClassType type : gssResources) {
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
}
int seed = Math.abs((int) checksum.getValue());
return encode(seed) + "-";
}
代码示例来源:origin: com.google.gwt/gwt-servlet
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void createFields(TreeLogger logger, ResourceContext context,
ClientBundleFields fields) throws UnableToCompleteException {
data.append(']');
StringBuffer wrappedData = new StringBuffer();
if (shouldUseJsonp(context, logger)) {
wrappedData.append(JSONP_CALLBACK_PREFIX);
wrappedData.append(getMd5HashOfData());
wrappedData.append(".onSuccess(\n");
wrappedData.append(data.toString());
wrappedData.append(")");
} else {
wrappedData = data;
}
urlExpression = context.deploy(
context.getClientBundleType().getQualifiedSourceName().replace('.', '_')
+ "_jsonbundle.txt", "text/plain", Util.getBytes(wrappedData.toString()), true);
TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
JClassType stringType = typeOracle.findType(String.class.getName());
assert stringType != null;
externalTextUrlIdent = fields.define(stringType, "externalTextUrl",
urlExpression, true, true);
JClassType textResourceType = typeOracle.findType(TextResource.class.getName());
assert textResourceType != null;
JType textResourceArrayType = typeOracle.getArrayType(textResourceType);
externalTextCacheIdent = fields.define(textResourceArrayType,
"externalTextCache", "new " + TextResource.class.getName() + "["
+ currentIndex + "]", true, true);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public Void call() throws Exception {
if (mode.isEmitClasses()) {
String fileName = state.type.getInternalName();
if (fileName == null) {
System.err.println("Got null filename from " + state.type);
return null;
}
fileName += ".class";
emitter.emit(fileName, state.contents);
}
if (mode.isEmitSource()) {
String sourcePath = getPackagePath(state.originalType) + state.source;
String destPath = getPackagePath(state.type) + state.source;
if (sources.add(sourcePath) && loader.exists(sourcePath)) {
String contents = Util.readStreamAsString(loader.getResourceAsStream(sourcePath));
emitter.emit(destPath, new ByteArrayInputStream(Util.getBytes(contents)));
}
}
return null;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
while (conflict != null) {
Adler32 hash = new Adler32();
hash.update(Util.getBytes(conflict));
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private String getMd5HashOfData() {
return Util.computeStrongName(Util.getBytes(data.toString()));
}
代码示例来源:origin: net.wetheinter/gwt-user
private String getMd5HashOfData() {
return Util.computeStrongName(Util.getBytes(data.toString()));
}
代码示例来源:origin: net.wetheinter/gwt-user
@Override
protected void doCreateBundleForPermutation(TreeLogger logger,
GeneratorContext generatorContext, FieldsImpl fields,
String generatedSimpleSourceName) throws UnableToCompleteException {
String partialPath = Util.computeStrongName(Util.getBytes(generatedSimpleSourceName))
+ BUNDLE_EXTENSION;
resourceContext.setPartialPath(partialPath);
fields.setInitializer(bundleBaseIdent,
"\"mhtml:\" + GWT.getModuleBaseURL() + \"" + partialPath + "!cid:\"");
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
protected void doCreateBundleForPermutation(TreeLogger logger,
GeneratorContext generatorContext, FieldsImpl fields,
String generatedSimpleSourceName) throws UnableToCompleteException {
String partialPath = Util.computeStrongName(Util.getBytes(generatedSimpleSourceName))
+ BUNDLE_EXTENSION;
resourceContext.setPartialPath(partialPath);
fields.setInitializer(bundleBaseIdent,
"\"mhtml:\" + GWT.getModuleBaseURL() + \"" + partialPath + "!cid:\"");
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private String computeDefaultPrefix(ResourceContext context) {
SortedSet<JClassType> gssResources = computeOperableTypes(context);
Adler32 checksum = new Adler32();
for (JClassType type : gssResources) {
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
}
int seed = Math.abs((int) checksum.getValue());
return encode(seed) + "-";
}
代码示例来源:origin: net.wetheinter/gwt-user
private String computeDefaultPrefix(ResourceContext context) {
SortedSet<JClassType> gssResources = computeOperableTypes(context);
Adler32 checksum = new Adler32();
for (JClassType type : gssResources) {
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
}
int seed = Math.abs((int) checksum.getValue());
return encode(seed) + "-";
}
代码示例来源:origin: net.wetheinter/gwt-user
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
checksum.update(Util.getBytes(type.getQualifiedSourceName()));
代码示例来源:origin: net.wetheinter/gwt-user
@Override
public void createFields(TreeLogger logger, ResourceContext context,
ClientBundleFields fields) throws UnableToCompleteException {
data.append(']');
StringBuffer wrappedData = new StringBuffer();
if (shouldUseJsonp(context, logger)) {
wrappedData.append(JSONP_CALLBACK_PREFIX);
wrappedData.append(getMd5HashOfData());
wrappedData.append(".onSuccess(\n");
wrappedData.append(data.toString());
wrappedData.append(")");
} else {
wrappedData = data;
}
urlExpression = context.deploy(
context.getClientBundleType().getQualifiedSourceName().replace('.', '_')
+ "_jsonbundle.txt", "text/plain", Util.getBytes(wrappedData.toString()), true);
TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
JClassType stringType = typeOracle.findType(String.class.getName());
assert stringType != null;
externalTextUrlIdent = fields.define(stringType, "externalTextUrl",
urlExpression, true, true);
JClassType textResourceType = typeOracle.findType(TextResource.class.getName());
assert textResourceType != null;
JType textResourceArrayType = typeOracle.getArrayType(textResourceType);
externalTextCacheIdent = fields.define(textResourceArrayType,
"externalTextCache", "new " + TextResource.class.getName() + "["
+ currentIndex + "]", true, true);
}
代码示例来源:origin: net.wetheinter/gwt-user
public Void call() throws Exception {
if (mode.isEmitClasses()) {
String fileName = state.type.getInternalName();
if (fileName == null) {
System.err.println("Got null filename from " + state.type);
return null;
}
fileName += ".class";
emitter.emit(fileName, state.contents);
}
if (mode.isEmitSource()) {
String sourcePath = getPackagePath(state.originalType) + state.source;
String destPath = getPackagePath(state.type) + state.source;
if (sources.add(sourcePath) && loader.exists(sourcePath)) {
String contents = Util.readStreamAsString(loader.getResourceAsStream(sourcePath));
emitter.emit(destPath, new ByteArrayInputStream(Util.getBytes(contents)));
}
}
return null;
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
@Override
public void createFields(TreeLogger logger, ResourceContext context,
ClientBundleFields fields) throws UnableToCompleteException {
data.append(']');
StringBuffer wrappedData = new StringBuffer();
if (shouldUseJsonp(context, logger)) {
wrappedData.append(JSONP_CALLBACK_PREFIX);
wrappedData.append(getMd5HashOfData());
wrappedData.append(".onSuccess(\n");
wrappedData.append(data.toString());
wrappedData.append(")");
} else {
wrappedData = data;
}
urlExpression = context.deploy(
context.getClientBundleType().getQualifiedSourceName().replace('.', '_')
+ "_jsonbundle.txt", "text/plain", Util.getBytes(wrappedData.toString()), true);
TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
JClassType stringType = typeOracle.findType(String.class.getName());
assert stringType != null;
externalTextUrlIdent = fields.define(stringType, "externalTextUrl",
urlExpression, true, true);
JClassType textResourceType = typeOracle.findType(TextResource.class.getName());
assert textResourceType != null;
JType textResourceArrayType = typeOracle.getArrayType(textResourceType);
externalTextCacheIdent = fields.define(textResourceArrayType,
"externalTextCache", "new " + TextResource.class.getName() + "["
+ currentIndex + "]", true, true);
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public Void call() throws Exception {
if (mode.isEmitClasses()) {
String fileName = state.type.getInternalName();
if (fileName == null) {
System.err.println("Got null filename from " + state.type);
return null;
}
fileName += ".class";
emitter.emit(fileName, state.contents);
}
if (mode.isEmitSource()) {
String sourcePath = getPackagePath(state.originalType) + state.source;
String destPath = getPackagePath(state.type) + state.source;
if (sources.add(sourcePath) && loader.exists(sourcePath)) {
String contents = Util.readStreamAsString(loader.getResourceAsStream(sourcePath));
emitter.emit(destPath, new ByteArrayInputStream(Util.getBytes(contents)));
}
}
return null;
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
while (conflict != null) {
Adler32 hash = new Adler32();
hash.update(Util.getBytes(conflict));
代码示例来源:origin: net.wetheinter/gwt-user
while (conflict != null) {
Adler32 hash = new Adler32();
hash.update(Util.getBytes(conflict));
内容来源于网络,如有侵权,请联系作者删除!