本文整理汇总了Java中com.sun.java.util.jar.pack.ConstantPool.Utf8Entry.stringValue方法的典型用法代码示例。如果您正苦于以下问题:Java Utf8Entry.stringValue方法的具体用法?Java Utf8Entry.stringValue怎么用?Java Utf8Entry.stringValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.java.util.jar.pack.ConstantPool.Utf8Entry
的用法示例。
在下文中一共展示了Utf8Entry.stringValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readAttrDefs
import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入方法依赖的package包/类
void readAttrDefs() throws IOException {
// attr_definition_bands:
// *attr_definition_headers :BYTE1
// *attr_definition_name :UNSIGNED5 (cp_Utf8)
// *attr_definition_layout :UNSIGNED5 (cp_Utf8)
attr_definition_headers.expectLength(numAttrDefs);
attr_definition_name.expectLength(numAttrDefs);
attr_definition_layout.expectLength(numAttrDefs);
attr_definition_headers.readFrom(in);
attr_definition_name.readFrom(in);
attr_definition_layout.readFrom(in);
try (PrintStream dump = !optDumpBands ? null
: new PrintStream(getDumpStream(attr_definition_headers, ".def")))
{
for (int i = 0; i < numAttrDefs; i++) {
int header = attr_definition_headers.getByte();
Utf8Entry name = (Utf8Entry) attr_definition_name.getRef();
Utf8Entry layout = (Utf8Entry) attr_definition_layout.getRef();
int ctype = (header & ADH_CONTEXT_MASK);
int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
Attribute.Layout def = new Attribute.Layout(ctype,
name.stringValue(),
layout.stringValue());
// Check layout string for Java 6 extensions.
String pvLayout = def.layoutForPackageMajver(getPackageMajver());
if (!pvLayout.equals(def.layout())) {
throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
}
this.setAttributeLayoutIndex(def, index);
if (dump != null) dump.println(index+" "+def);
}
}
attr_definition_headers.doneDisbursing();
attr_definition_name.doneDisbursing();
attr_definition_layout.doneDisbursing();
// Attribute layouts define bands, one per layout element.
// Create them now, all at once.
makeNewAttributeBands();
attr_definition_bands.doneDisbursing();
}
示例2: File
import com.sun.java.util.jar.pack.ConstantPool.Utf8Entry; //导入方法依赖的package包/类
File(Utf8Entry name) {
this.name = name;
this.nameString = name.stringValue();
// caller must fill in contents
}