code: public byte[] toByteArray() {
          // computes the real size of the bytecode of this class
          final int interfaceCount = interfaces.length;
          int size = 24 + 2 * interfaceCount;
  //        if (fields != null) {
  //            size += fields.length;
  //        }
          for (MethodWriter cb : this.methods) {
              size += cb.getSize();
          }
  //        int attributeCount = 0;
  //        if ((access & Constants.ACC_DEPRECATED) != 0) {
  //            ++attributeCount;
  //            size += 6;
  //        }
  //        if ((access & Constants.ACC_SYNTHETIC) != 0) {
  //            ++attributeCount;
  //            size += 6;
  //        }
          size += pool.length;
          // allocates a byte vector of this size, in order to avoid unnecessary
          // arraycopy operations in the ByteBuffer.enlarge() method
          final ByteBuffer out = new ByteBuffer(size);
          out.putInt(0xCAFEBABE).putInt(version);
          out.putShort(poolIndex).put(pool);
          out.putShort(access).putShort(name).putShort(superName);
          out.putShort(interfaceCount);
          for (int i = 0; i < interfaceCount; ++i) {
              out.putShort(interfaces[i]);
          }
          out.putShort(0); //out.putShort(fieldCount);
  //        if (fields != null) {
  //            out.put(fields);
  //        }
          out.putShort(this.methods.size());
          for (MethodWriter cb : this.methods) {
              cb.renderTo(out);
          }
          out.putShort(0 /* attributeCount */);
  //        if ((access & Constants.ACC_DEPRECATED) != 0) {
  //            out.putShort(newUTF8("Deprecated")).putInt(0);
  //        }
  //        if ((access & Constants.ACC_SYNTHETIC) != 0) {
  //            out.putShort(newUTF8("Synthetic")).putInt(0);
  //        }
          return out.data;
      }
docs: Returns the bytecode of the class that was build with this class writer.
  
  @return the bytecode of the class that was build with this class writer.