private int getOrInsertClass(int nameIndex) throws IOException {
   int classIndex = constantPool.lookForClass(nameIndex);
   if (classIndex == -1) {
     classIndex = constantPool.poolSize() + 1;
     ClassConstant classConstant = new ClassConstant(nameIndex);
     constantPool.add(classConstant);
     classConstant.serializeToStream(constantStream);
   }
   return classIndex;
 }
 private int getObjectClassIndex() {
   int objectClassName =
       constantPool.lookForUtf8Reference(Object.class.getName().replace(".", "/"));
   return constantPool.lookForClass(objectClassName);
 }