コード例 #1
0
 private int getOrInsertUtf8(String string) throws IOException {
   int nameIndex = constantPool.lookForUtf8Reference(string);
   if (nameIndex == -1) {
     nameIndex = constantPool.poolSize() + 1;
     Utf8Constant name = new Utf8Constant(string);
     constantPool.add(name);
     name.serializeToStream(constantStream);
   }
   return nameIndex;
 }
コード例 #2
0
 private int getObjectClassIndex() {
   int objectClassName =
       constantPool.lookForUtf8Reference(Object.class.getName().replace(".", "/"));
   return constantPool.lookForClass(objectClassName);
 }