Class Constant

    • Constructor Summary

      Constructors 
      Constructor Description
      Constant​(Constant[] pool)
      Creates an instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Constant[] extractConstantPool​(java.io.DataInputStream stream)
      Extracts the constant pool from the specified data stream of a class file.
      Constant getConstant​(int index)
      Returns the specified constant from the pool.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Constant

        public Constant​(Constant[] pool)
        Creates an instance.
        Parameters:
        pool - The poole which will be needed to resolve references.
    • Method Detail

      • extractConstantPool

        public static Constant[] extractConstantPool​(java.io.DataInputStream stream)
                                              throws java.io.IOException
        Extracts the constant pool from the specified data stream of a class file.
        Parameters:
        stream - Input stream of a class file starting at the first byte.
        Returns:
        extracted array of constants.
        Throws:
        java.io.IOException - in case of reading errors or invalid class file.
      • getConstant

        public Constant getConstant​(int index)
        Returns the specified constant from the pool.
        Parameters:
        index - Index of requested constant.