Class CpBands


  • public class CpBands
    extends BandSet
    Constant Pool bands
    • Field Detail

      • cpClass

        private java.lang.String[] cpClass
      • cpClassInts

        private int[] cpClassInts
      • cpDescriptorNameInts

        private int[] cpDescriptorNameInts
      • cpDescriptorTypeInts

        private int[] cpDescriptorTypeInts
      • cpDescriptor

        private java.lang.String[] cpDescriptor
      • cpDouble

        private double[] cpDouble
      • cpFieldClass

        private java.lang.String[] cpFieldClass
      • cpFieldDescriptor

        private java.lang.String[] cpFieldDescriptor
      • cpFieldClassInts

        private int[] cpFieldClassInts
      • cpFieldDescriptorInts

        private int[] cpFieldDescriptorInts
      • cpFloat

        private float[] cpFloat
      • cpIMethodClass

        private java.lang.String[] cpIMethodClass
      • cpIMethodDescriptor

        private java.lang.String[] cpIMethodDescriptor
      • cpIMethodClassInts

        private int[] cpIMethodClassInts
      • cpIMethodDescriptorInts

        private int[] cpIMethodDescriptorInts
      • cpInt

        private int[] cpInt
      • cpLong

        private long[] cpLong
      • cpMethodClass

        private java.lang.String[] cpMethodClass
      • cpMethodDescriptor

        private java.lang.String[] cpMethodDescriptor
      • cpMethodClassInts

        private int[] cpMethodClassInts
      • cpMethodDescriptorInts

        private int[] cpMethodDescriptorInts
      • cpSignature

        private java.lang.String[] cpSignature
      • cpSignatureInts

        private int[] cpSignatureInts
      • cpString

        private java.lang.String[] cpString
      • cpStringInts

        private int[] cpStringInts
      • cpUTF8

        private java.lang.String[] cpUTF8
      • stringsToCPUTF8

        private final java.util.Map<java.lang.String,​CPUTF8> stringsToCPUTF8
      • stringsToCPStrings

        private final java.util.Map<java.lang.String,​CPString> stringsToCPStrings
      • longsToCPLongs

        private final java.util.Map<java.lang.Long,​CPLong> longsToCPLongs
      • integersToCPIntegers

        private final java.util.Map<java.lang.Integer,​CPInteger> integersToCPIntegers
      • floatsToCPFloats

        private final java.util.Map<java.lang.Float,​CPFloat> floatsToCPFloats
      • stringsToCPClass

        private final java.util.Map<java.lang.String,​CPClass> stringsToCPClass
      • doublesToCPDoubles

        private final java.util.Map<java.lang.Double,​CPDouble> doublesToCPDoubles
      • descriptorsToCPNameAndTypes

        private final java.util.Map<java.lang.String,​CPNameAndType> descriptorsToCPNameAndTypes
      • mapClass

        private java.util.Map<java.lang.String,​java.lang.Integer> mapClass
      • mapDescriptor

        private java.util.Map<java.lang.String,​java.lang.Integer> mapDescriptor
      • mapUTF8

        private java.util.Map<java.lang.String,​java.lang.Integer> mapUTF8
      • mapSignature

        private java.util.Map<java.lang.String,​java.lang.Integer> mapSignature
      • intOffset

        private int intOffset
      • floatOffset

        private int floatOffset
      • longOffset

        private int longOffset
      • doubleOffset

        private int doubleOffset
      • stringOffset

        private int stringOffset
      • classOffset

        private int classOffset
      • signatureOffset

        private int signatureOffset
      • descrOffset

        private int descrOffset
      • fieldOffset

        private int fieldOffset
      • methodOffset

        private int methodOffset
      • imethodOffset

        private int imethodOffset
    • Constructor Detail

      • CpBands

        public CpBands​(Segment segment)
    • Method Detail

      • cpClassValue

        public CPClass cpClassValue​(int index)
      • cpClassValue

        public CPClass cpClassValue​(java.lang.String string)
      • cpDoubleValue

        public CPDouble cpDoubleValue​(int index)
      • cpFieldValue

        public CPFieldRef cpFieldValue​(int index)
      • cpFloatValue

        public CPFloat cpFloatValue​(int index)
      • cpIntegerValue

        public CPInteger cpIntegerValue​(int index)
      • cpLongValue

        public CPLong cpLongValue​(int index)
      • cpMethodValue

        public CPMethodRef cpMethodValue​(int index)
      • cpNameAndTypeValue

        public CPNameAndType cpNameAndTypeValue​(int index)
      • cpNameAndTypeValue

        public CPNameAndType cpNameAndTypeValue​(java.lang.String descriptor)
      • cpSignatureValue

        public CPUTF8 cpSignatureValue​(int index)
      • cpStringValue

        public CPString cpStringValue​(int index)
      • cpUTF8Value

        public CPUTF8 cpUTF8Value​(int index)
      • cpUTF8Value

        public CPUTF8 cpUTF8Value​(java.lang.String string)
      • cpUTF8Value

        public CPUTF8 cpUTF8Value​(java.lang.String string,
                                  boolean searchForIndex)
      • getCpClass

        public java.lang.String[] getCpClass()
      • getCpDescriptor

        public java.lang.String[] getCpDescriptor()
      • getCpDescriptorNameInts

        public int[] getCpDescriptorNameInts()
      • getCpDescriptorTypeInts

        public int[] getCpDescriptorTypeInts()
      • getCpFieldClass

        public java.lang.String[] getCpFieldClass()
      • getCpIMethodClass

        public java.lang.String[] getCpIMethodClass()
      • getCpInt

        public int[] getCpInt()
      • getCpLong

        public long[] getCpLong()
      • getCpMethodClass

        public java.lang.String[] getCpMethodClass()
      • getCpMethodDescriptor

        public java.lang.String[] getCpMethodDescriptor()
      • getCpSignature

        public java.lang.String[] getCpSignature()
      • getCpUTF8

        public java.lang.String[] getCpUTF8()
      • parseCpClass

        private void parseCpClass​(java.io.InputStream in)
                           throws java.io.IOException,
                                  Pack200Exception
        Parses the constant pool class names, using #cpClassCount to populate cpClass from cpUTF8.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpDescriptor

        private void parseCpDescriptor​(java.io.InputStream in)
                                throws java.io.IOException,
                                       Pack200Exception
        Parses the constant pool descriptor definitions, using #cpDescriptorCount to populate cpDescriptor. For ease of use, the cpDescriptor is stored as a string of the form name:type, largely to make it easier for representing field and method descriptors (e.g. out:java.lang.PrintStream) in a way that is compatible with passing String arrays.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpDouble

        private void parseCpDouble​(java.io.InputStream in)
                            throws java.io.IOException,
                                   Pack200Exception
        Throws:
        java.io.IOException
        Pack200Exception
      • parseCpField

        private void parseCpField​(java.io.InputStream in)
                           throws java.io.IOException,
                                  Pack200Exception
        Parses the constant pool field definitions, using #cpFieldCount to populate cpFieldClass and cpFieldDescriptor.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpFloat

        private void parseCpFloat​(java.io.InputStream in)
                           throws java.io.IOException,
                                  Pack200Exception
        Throws:
        java.io.IOException
        Pack200Exception
      • parseCpIMethod

        private void parseCpIMethod​(java.io.InputStream in)
                             throws java.io.IOException,
                                    Pack200Exception
        Parses the constant pool interface method definitions, using #cpIMethodCount to populate cpIMethodClass and cpIMethodDescriptor.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpMethod

        private void parseCpMethod​(java.io.InputStream in)
                            throws java.io.IOException,
                                   Pack200Exception
        Parses the constant pool method definitions, using #cpMethodCount to populate cpMethodClass and cpMethodDescriptor.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpSignature

        private void parseCpSignature​(java.io.InputStream in)
                               throws java.io.IOException,
                                      Pack200Exception
        Parses the constant pool signature classes, using #cpSignatureCount to populate cpSignature. A signature form is akin to the bytecode representation of a class; Z for boolean, I for int, [ for array etc. However, although classes are started with L, the class name does not follow the form; instead, there is a separate array of classes. So an array corresponding to public static void main(String args[]) has a form of [L(V) and a classes array of [java.lang.String]. The cpSignature is a string representation identical to the bytecode equivalent [Ljava/lang/String;(V) TODO Check that the form is as above and update other types e.g. J
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • parseCpString

        private void parseCpString​(java.io.InputStream in)
                            throws java.io.IOException,
                                   Pack200Exception
        Parses the constant pool strings, using #cpStringCount to populate cpString from indexes into cpUTF8.
        Parameters:
        in - the input stream to read from
        Throws:
        java.io.IOException - if a problem occurs during reading from the underlying stream
        Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
      • unpack

        public void unpack()
        Specified by:
        unpack in class BandSet