- java.lang.Object
-
- kala.compress.harmony.unpack200.BandSet
-
- kala.compress.harmony.unpack200.CpBands
-
public class CpBands extends BandSet
Constant Pool bands
-
-
Field Summary
Fields Modifier and Type Field Description private intclassOffsetprivate java.lang.String[]cpClassprivate int[]cpClassIntsprivate java.lang.String[]cpDescriptorprivate int[]cpDescriptorNameIntsprivate int[]cpDescriptorTypeIntsprivate double[]cpDoubleprivate java.lang.String[]cpFieldClassprivate int[]cpFieldClassIntsprivate java.lang.String[]cpFieldDescriptorprivate int[]cpFieldDescriptorIntsprivate float[]cpFloatprivate java.lang.String[]cpIMethodClassprivate int[]cpIMethodClassIntsprivate java.lang.String[]cpIMethodDescriptorprivate int[]cpIMethodDescriptorIntsprivate int[]cpIntprivate long[]cpLongprivate java.lang.String[]cpMethodClassprivate int[]cpMethodClassIntsprivate java.lang.String[]cpMethodDescriptorprivate int[]cpMethodDescriptorIntsprivate java.lang.String[]cpSignatureprivate int[]cpSignatureIntsprivate java.lang.String[]cpStringprivate int[]cpStringIntsprivate java.lang.String[]cpUTF8private java.util.Map<java.lang.String,CPNameAndType>descriptorsToCPNameAndTypesprivate intdescrOffsetprivate intdoubleOffsetprivate java.util.Map<java.lang.Double,CPDouble>doublesToCPDoublesprivate static java.lang.StringEMPTY_STRINGprivate intfieldOffsetprivate intfloatOffsetprivate java.util.Map<java.lang.Float,CPFloat>floatsToCPFloatsprivate intimethodOffsetprivate java.util.Map<java.lang.Integer,CPInteger>integersToCPIntegersprivate intintOffsetprivate intlongOffsetprivate java.util.Map<java.lang.Long,CPLong>longsToCPLongsprivate java.util.Map<java.lang.String,java.lang.Integer>mapClassprivate java.util.Map<java.lang.String,java.lang.Integer>mapDescriptorprivate java.util.Map<java.lang.String,java.lang.Integer>mapSignatureprivate java.util.Map<java.lang.String,java.lang.Integer>mapUTF8private intmethodOffsetprivate SegmentConstantPoolpoolprivate intsignatureOffsetprivate intstringOffsetprivate java.util.Map<java.lang.String,CPClass>stringsToCPClassprivate java.util.Map<java.lang.String,CPString>stringsToCPStringsprivate java.util.Map<java.lang.String,CPUTF8>stringsToCPUTF8
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CPClasscpClassValue(int index)CPClasscpClassValue(java.lang.String string)CPDoublecpDoubleValue(int index)CPFieldRefcpFieldValue(int index)CPFloatcpFloatValue(int index)CPInterfaceMethodRefcpIMethodValue(int index)CPIntegercpIntegerValue(int index)CPLongcpLongValue(int index)CPMethodRefcpMethodValue(int index)CPNameAndTypecpNameAndTypeValue(int index)CPNameAndTypecpNameAndTypeValue(java.lang.String descriptor)CPUTF8cpSignatureValue(int index)CPStringcpStringValue(int index)CPUTF8cpUTF8Value(int index)CPUTF8cpUTF8Value(java.lang.String string)CPUTF8cpUTF8Value(java.lang.String string, boolean searchForIndex)SegmentConstantPoolgetConstantPool()java.lang.String[]getCpClass()java.lang.String[]getCpDescriptor()int[]getCpDescriptorNameInts()int[]getCpDescriptorTypeInts()java.lang.String[]getCpFieldClass()java.lang.String[]getCpIMethodClass()int[]getCpInt()long[]getCpLong()java.lang.String[]getCpMethodClass()java.lang.String[]getCpMethodDescriptor()java.lang.String[]getCpSignature()java.lang.String[]getCpUTF8()private voidparseCpClass(java.io.InputStream in)private voidparseCpDescriptor(java.io.InputStream in)Parses the constant pool descriptor definitions, using#cpDescriptorCountto populatecpDescriptor.private voidparseCpDouble(java.io.InputStream in)private voidparseCpField(java.io.InputStream in)Parses the constant pool field definitions, using#cpFieldCountto populatecpFieldClassandcpFieldDescriptor.private voidparseCpFloat(java.io.InputStream in)private voidparseCpIMethod(java.io.InputStream in)Parses the constant pool interface method definitions, using#cpIMethodCountto populatecpIMethodClassandcpIMethodDescriptor.private voidparseCpInt(java.io.InputStream in)private voidparseCpLong(java.io.InputStream in)private voidparseCpMethod(java.io.InputStream in)Parses the constant pool method definitions, using#cpMethodCountto populatecpMethodClassandcpMethodDescriptor.private voidparseCpSignature(java.io.InputStream in)Parses the constant pool signature classes, using#cpSignatureCountto populatecpSignature.private voidparseCpString(java.io.InputStream in)private voidparseCpUtf8(java.io.InputStream in)voidread(java.io.InputStream in)voidunpack()-
Methods inherited from class kala.compress.harmony.unpack200.BandSet
decodeBandInt, decodeBandInt, getReferences, getReferences, parseCPClassReferences, parseCPDescriptorReferences, parseCPDoubleReferences, parseCPFieldRefReferences, parseCPFloatReferences, parseCPInterfaceMethodRefReferences, parseCPIntReferences, parseCPLongReferences, parseCPMethodRefReferences, parseCPSignatureReferences, parseCPSignatureReferences, parseCPStringReferences, parseCPUTF8References, parseCPUTF8References, parseFlags, parseFlags, parseFlags, parseFlags, parseReferences, parseReferences, unpack
-
-
-
-
Field Detail
-
EMPTY_STRING
private static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
-
pool
private final SegmentConstantPool pool
-
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)
-
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(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)
-
getConstantPool
public SegmentConstantPool getConstantPool()
-
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- Parameters:
in- the input stream to read from- Throws:
java.io.IOException- if a problem occurs during reading from the underlying streamPack200Exception- if a problem occurs with an unexpected value or unsupported codec
-
parseCpDescriptor
private void parseCpDescriptor(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool descriptor definitions, using#cpDescriptorCountto populatecpDescriptor. 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 streamPack200Exception- 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.IOExceptionPack200Exception
-
parseCpField
private void parseCpField(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool field definitions, using#cpFieldCountto populatecpFieldClassandcpFieldDescriptor.- Parameters:
in- the input stream to read from- Throws:
java.io.IOException- if a problem occurs during reading from the underlying streamPack200Exception- 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.IOExceptionPack200Exception
-
parseCpIMethod
private void parseCpIMethod(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool interface method definitions, using#cpIMethodCountto populatecpIMethodClassandcpIMethodDescriptor.- Parameters:
in- the input stream to read from- Throws:
java.io.IOException- if a problem occurs during reading from the underlying streamPack200Exception- if a problem occurs with an unexpected value or unsupported codec
-
parseCpInt
private void parseCpInt(java.io.InputStream in) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseCpLong
private void parseCpLong(java.io.InputStream in) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseCpMethod
private void parseCpMethod(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool method definitions, using#cpMethodCountto populatecpMethodClassandcpMethodDescriptor.- Parameters:
in- the input stream to read from- Throws:
java.io.IOException- if a problem occurs during reading from the underlying streamPack200Exception- if a problem occurs with an unexpected value or unsupported codec
-
parseCpSignature
private void parseCpSignature(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool signature classes, using#cpSignatureCountto populatecpSignature. 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 topublic static void main(String args[])has a form of[L(V)and a classes array of[java.lang.String]. ThecpSignatureis 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 streamPack200Exception- if a problem occurs with an unexpected value or unsupported codec
-
parseCpString
private void parseCpString(java.io.InputStream in) throws java.io.IOException, Pack200ExceptionParses the constant pool strings, using#cpStringCountto populatecpStringfrom indexes intocpUTF8.- Parameters:
in- the input stream to read from- Throws:
java.io.IOException- if a problem occurs during reading from the underlying streamPack200Exception- if a problem occurs with an unexpected value or unsupported codec
-
parseCpUtf8
private void parseCpUtf8(java.io.InputStream in) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
read
public void read(java.io.InputStream in) throws java.io.IOException, Pack200Exception- Specified by:
readin classBandSet- Throws:
java.io.IOExceptionPack200Exception
-
-