Class ConstantPool


  • public class ConstantPool
    extends java.lang.Object
    • Constructor Detail

      • ConstantPool

        ConstantPool​(java.io.DataInputStream input)
              throws java.io.IOException
        https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4
        Parameters:
        input - the stream of the class
        Throws:
        java.io.IOException - if any IO error occur
    • Method Detail

      • get

        public java.lang.Object get​(int index)
        Get a object from the pool at the given index.
        Parameters:
        index - the index
        Returns:
        the object
      • set

        void set​(int index,
                 java.lang.Object value)
        Set a value in the constant pool.
        Parameters:
        index - the index
        value - the new value
      • size

        int size()
        Get the count of entries in the pool.
        Returns:
        the count