java.lang.Object
kala.compress.harmony.unpack200.BandSet
kala.compress.harmony.unpack200.CpBands

public class CpBands extends BandSet
Constant Pool bands
  • Field Details

    • EMPTY_STRING

      private static final String EMPTY_STRING
      See Also:
    • pool

      private final SegmentConstantPool pool
    • cpClass

      private String[] cpClass
    • cpClassInts

      private int[] cpClassInts
    • cpDescriptorNameInts

      private int[] cpDescriptorNameInts
    • cpDescriptorTypeInts

      private int[] cpDescriptorTypeInts
    • cpDescriptor

      private String[] cpDescriptor
    • cpDouble

      private double[] cpDouble
    • cpFieldClass

      private String[] cpFieldClass
    • cpFieldDescriptor

      private String[] cpFieldDescriptor
    • cpFieldClassInts

      private int[] cpFieldClassInts
    • cpFieldDescriptorInts

      private int[] cpFieldDescriptorInts
    • cpFloat

      private float[] cpFloat
    • cpIMethodClass

      private String[] cpIMethodClass
    • cpIMethodDescriptor

      private String[] cpIMethodDescriptor
    • cpIMethodClassInts

      private int[] cpIMethodClassInts
    • cpIMethodDescriptorInts

      private int[] cpIMethodDescriptorInts
    • cpInt

      private int[] cpInt
    • cpLong

      private long[] cpLong
    • cpMethodClass

      private String[] cpMethodClass
    • cpMethodDescriptor

      private String[] cpMethodDescriptor
    • cpMethodClassInts

      private int[] cpMethodClassInts
    • cpMethodDescriptorInts

      private int[] cpMethodDescriptorInts
    • cpSignature

      private String[] cpSignature
    • cpSignatureInts

      private int[] cpSignatureInts
    • cpString

      private String[] cpString
    • cpStringInts

      private int[] cpStringInts
    • cpUTF8

      private String[] cpUTF8
    • stringsToCPUTF8

      private final Map<String,CPUTF8> stringsToCPUTF8
    • stringsToCPStrings

      private final Map<String,CPString> stringsToCPStrings
    • longsToCPLongs

      private final Map<Long,CPLong> longsToCPLongs
    • integersToCPIntegers

      private final Map<Integer,CPInteger> integersToCPIntegers
    • floatsToCPFloats

      private final Map<Float,CPFloat> floatsToCPFloats
    • stringsToCPClass

      private final Map<String,CPClass> stringsToCPClass
    • doublesToCPDoubles

      private final Map<Double,CPDouble> doublesToCPDoubles
    • descriptorsToCPNameAndTypes

      private final Map<String,CPNameAndType> descriptorsToCPNameAndTypes
    • mapClass

      private Map<String,Integer> mapClass
    • mapDescriptor

      private Map<String,Integer> mapDescriptor
    • mapUTF8

      private Map<String,Integer> mapUTF8
    • mapSignature

      private Map<String,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 Details

    • CpBands

      public CpBands(Segment segment)
  • Method Details

    • cpClassValue

      public CPClass cpClassValue(int index)
    • cpClassValue

      public CPClass cpClassValue(String string)
    • cpDoubleValue

      public CPDouble cpDoubleValue(int index)
    • cpFieldValue

      public CPFieldRef cpFieldValue(int index)
    • cpFloatValue

      public CPFloat cpFloatValue(int index)
    • cpIMethodValue

      public CPInterfaceMethodRef cpIMethodValue(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(String descriptor)
    • cpSignatureValue

      public CPUTF8 cpSignatureValue(int index)
    • cpStringValue

      public CPString cpStringValue(int index)
    • cpUTF8Value

      public CPUTF8 cpUTF8Value(int index)
    • cpUTF8Value

      public CPUTF8 cpUTF8Value(String string)
    • cpUTF8Value

      public CPUTF8 cpUTF8Value(String string, boolean searchForIndex)
    • getConstantPool

      public SegmentConstantPool getConstantPool()
    • getCpClass

      public String[] getCpClass()
    • getCpDescriptor

      public String[] getCpDescriptor()
    • getCpDescriptorNameInts

      public int[] getCpDescriptorNameInts()
    • getCpDescriptorTypeInts

      public int[] getCpDescriptorTypeInts()
    • getCpFieldClass

      public String[] getCpFieldClass()
    • getCpIMethodClass

      public String[] getCpIMethodClass()
    • getCpInt

      public int[] getCpInt()
    • getCpLong

      public long[] getCpLong()
    • getCpMethodClass

      public String[] getCpMethodClass()
    • getCpMethodDescriptor

      public String[] getCpMethodDescriptor()
    • getCpSignature

      public String[] getCpSignature()
    • getCpUTF8

      public String[] getCpUTF8()
    • parseCpClass

      private void parseCpClass(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool class names, using
      invalid reference
      #cpClassCount
      to populate cpClass from cpUTF8.
      Parameters:
      in - the input stream to read from
      Throws:
      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(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool descriptor definitions, using
      invalid reference
      #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:
      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(InputStream in) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • parseCpField

      private void parseCpField(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool field definitions, using
      invalid reference
      #cpFieldCount
      to populate cpFieldClass and cpFieldDescriptor.
      Parameters:
      in - the input stream to read from
      Throws:
      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(InputStream in) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • parseCpIMethod

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

      private void parseCpInt(InputStream in) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • parseCpLong

      private void parseCpLong(InputStream in) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • parseCpMethod

      private void parseCpMethod(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool method definitions, using
      invalid reference
      #cpMethodCount
      to populate cpMethodClass and cpMethodDescriptor.
      Parameters:
      in - the input stream to read from
      Throws:
      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(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool signature classes, using
      invalid reference
      #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:
      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(InputStream in) throws IOException, Pack200Exception
      Parses the constant pool strings, using
      invalid reference
      #cpStringCount
      to populate cpString from indexes into cpUTF8.
      Parameters:
      in - the input stream to read from
      Throws:
      IOException - if a problem occurs during reading from the underlying stream
      Pack200Exception - if a problem occurs with an unexpected value or unsupported codec
    • parseCpUtf8

      private void parseCpUtf8(InputStream in) throws IOException, Pack200Exception
      Throws:
      IOException
      Pack200Exception
    • read

      public void read(InputStream in) throws IOException, Pack200Exception
      Specified by:
      read in class BandSet
      Throws:
      IOException
      Pack200Exception
    • unpack

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