- java.lang.Object
-
- kala.compress.harmony.unpack200.BandSet
-
- Direct Known Subclasses:
AttrDefinitionBands,BcBands,ClassBands,CpBands,FileBands,IcBands,NewAttributeBands
public abstract class BandSet extends java.lang.ObjectAbstract superclass for a set of bands.
-
-
Field Summary
Fields Modifier and Type Field Description protected SegmentHeaderheaderprotected Segmentsegment
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int[]decodeBandInt(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)Decodes a band and return an array ofintvalues.int[][]decodeBandInt(java.lang.String name, java.io.InputStream in, BHSDCodec defaultCodec, int[] counts)Decodes a band and return an array ofint[]values.protected java.lang.String[][]getReferences(int[][] ints, java.lang.String[] reference)protected java.lang.String[]getReferences(int[] ints, java.lang.String[] reference)CPClass[]parseCPClassReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPNameAndType[]parseCPDescriptorReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPDouble[]parseCPDoubleReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPFieldRef[]parseCPFieldRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPFloat[]parseCPFloatReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPInterfaceMethodRef[]parseCPInterfaceMethodRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPInteger[]parseCPIntReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPLong[]parseCPLongReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPMethodRef[]parseCPMethodRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPUTF8[]parseCPSignatureReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)protected CPUTF8[][]parseCPSignatureReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts)CPString[]parseCPStringReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPUTF8[]parseCPUTF8References(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count)CPUTF8[][]parseCPUTF8References(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts)long[][]parseFlags(java.lang.String name, java.io.InputStream in, int[] counts, BHSDCodec codec, boolean hasHi)long[][]parseFlags(java.lang.String name, java.io.InputStream in, int[] counts, BHSDCodec hiCodec, BHSDCodec loCodec)long[]parseFlags(java.lang.String name, java.io.InputStream in, int count, BHSDCodec codec, boolean hasHi)long[]parseFlags(java.lang.String name, java.io.InputStream in, int count, BHSDCodec hiCodec, BHSDCodec loCodec)java.lang.String[][]parseReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts, java.lang.String[] reference)Parses count references fromin, usingcodecto decode the values as indexes intoreference(which is populated prior to this call).java.lang.String[]parseReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count, java.lang.String[] reference)Parses count references fromin, usingcodecto decode the values as indexes intoreference(which is populated prior to this call).abstract voidread(java.io.InputStream inputStream)abstract voidunpack()voidunpack(java.io.InputStream in)
-
-
-
Field Detail
-
segment
protected Segment segment
-
header
protected SegmentHeader header
-
-
Constructor Detail
-
BandSet
public BandSet(Segment segment)
-
-
Method Detail
-
decodeBandInt
public int[] decodeBandInt(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200ExceptionDecodes a band and return an array ofintvalues.- Parameters:
name- the name of the band (primarily for logging/debugging purposes)in- the InputStream to decode fromcodec- the default Codec for this bandcount- the number of elements to read- Returns:
- an array of decoded
intvalues - Throws:
java.io.IOException- if there is a problem reading from the underlying input streamPack200Exception- if there is a problem decoding the value or that the value is invalid
-
decodeBandInt
public int[][] decodeBandInt(java.lang.String name, java.io.InputStream in, BHSDCodec defaultCodec, int[] counts) throws java.io.IOException, Pack200ExceptionDecodes a band and return an array ofint[]values.- Parameters:
name- the name of the band (primarily for logging/debugging purposes)in- the InputStream to decode fromdefaultCodec- the default codec for this bandcounts- the numbers of elements to read for each int array within the array to be returned- Returns:
- an array of decoded
int[]values - Throws:
java.io.IOException- if there is a problem reading from the underlying input streamPack200Exception- if there is a problem decoding the value or that the value is invalid
-
getReferences
protected java.lang.String[] getReferences(int[] ints, java.lang.String[] reference)
-
getReferences
protected java.lang.String[][] getReferences(int[][] ints, java.lang.String[] reference)
-
parseCPClassReferences
public CPClass[] parseCPClassReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPDescriptorReferences
public CPNameAndType[] parseCPDescriptorReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPDoubleReferences
public CPDouble[] parseCPDoubleReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPFieldRefReferences
public CPFieldRef[] parseCPFieldRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPFloatReferences
public CPFloat[] parseCPFloatReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPInterfaceMethodRefReferences
public CPInterfaceMethodRef[] parseCPInterfaceMethodRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPIntReferences
public CPInteger[] parseCPIntReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPLongReferences
public CPLong[] parseCPLongReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPMethodRefReferences
public CPMethodRef[] parseCPMethodRefReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPSignatureReferences
public CPUTF8[] parseCPSignatureReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPSignatureReferences
protected CPUTF8[][] parseCPSignatureReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPStringReferences
public CPString[] parseCPStringReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPUTF8References
public CPUTF8[] parseCPUTF8References(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseCPUTF8References
public CPUTF8[][] parseCPUTF8References(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts) throws java.io.IOException, Pack200Exception
- Throws:
java.io.IOExceptionPack200Exception
-
parseFlags
public long[] parseFlags(java.lang.String name, java.io.InputStream in, int count, BHSDCodec hiCodec, BHSDCodec loCodec) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseFlags
public long[] parseFlags(java.lang.String name, java.io.InputStream in, int count, BHSDCodec codec, boolean hasHi) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseFlags
public long[][] parseFlags(java.lang.String name, java.io.InputStream in, int[] counts, BHSDCodec hiCodec, BHSDCodec loCodec) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseFlags
public long[][] parseFlags(java.lang.String name, java.io.InputStream in, int[] counts, BHSDCodec codec, boolean hasHi) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
parseReferences
public java.lang.String[] parseReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int count, java.lang.String[] reference) throws java.io.IOException, Pack200ExceptionParses count references fromin, usingcodecto decode the values as indexes intoreference(which is populated prior to this call). An exception is thrown if a decoded index falls outside the range [0..reference.length-1].- Parameters:
name- the band namein- the input stream to read fromcodec- the BHSDCodec to use for decodingcount- the number of references to decodereference- the array of values to use for the references- Returns:
- Parsed references.
- 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
-
parseReferences
public java.lang.String[][] parseReferences(java.lang.String name, java.io.InputStream in, BHSDCodec codec, int[] counts, java.lang.String[] reference) throws java.io.IOException, Pack200ExceptionParses count references fromin, usingcodecto decode the values as indexes intoreference(which is populated prior to this call). An exception is thrown if a decoded index falls outside the range [0..reference.length-1]. Unlike the other parseReferences, this post-processes the result into an array of results.- Parameters:
name- TODOin- the input stream to read fromcodec- the BHSDCodec to use for decodingcounts- the numbers of references to decode for each array entryreference- the array of values to use for the references- Returns:
- Parsed references.
- 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
-
read
public abstract void read(java.io.InputStream inputStream) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
unpack
public abstract void unpack() throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
unpack
public void unpack(java.io.InputStream in) throws java.io.IOException, Pack200Exception- Throws:
java.io.IOExceptionPack200Exception
-
-