Class BandSet
java.lang.Object
org.apache.commons.compress.harmony.unpack200.BandSet
- Direct Known Subclasses:
AttrDefinitionBands
,BcBands
,ClassBands
,CpBands
,FileBands
,IcBands
,NewAttributeBands
Abstract superclass for a set of bands.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint[]
decodeBandInt
(String name, InputStream in, BHSDCodec codec, int count) Decodes a band and return an array ofint
values.int[][]
decodeBandInt
(String name, InputStream in, BHSDCodec defaultCodec, int[] counts) Decodes a band and return an array ofint[]
values.protected String[][]
getReferences
(int[][] ints, String[] reference) protected String[]
getReferences
(int[] ints, String[] reference) CPClass[]
parseCPClassReferences
(String name, InputStream in, BHSDCodec codec, int count) parseCPDescriptorReferences
(String name, InputStream in, BHSDCodec codec, int count) CPDouble[]
parseCPDoubleReferences
(String name, InputStream in, BHSDCodec codec, int count) parseCPFieldRefReferences
(String name, InputStream in, BHSDCodec codec, int count) CPFloat[]
parseCPFloatReferences
(String name, InputStream in, BHSDCodec codec, int count) parseCPInterfaceMethodRefReferences
(String name, InputStream in, BHSDCodec codec, int count) parseCPIntReferences
(String name, InputStream in, BHSDCodec codec, int count) CPLong[]
parseCPLongReferences
(String name, InputStream in, BHSDCodec codec, int count) parseCPMethodRefReferences
(String name, InputStream in, BHSDCodec codec, int count) CPUTF8[]
parseCPSignatureReferences
(String name, InputStream in, BHSDCodec codec, int count) protected CPUTF8[][]
parseCPSignatureReferences
(String name, InputStream in, BHSDCodec codec, int[] counts) CPString[]
parseCPStringReferences
(String name, InputStream in, BHSDCodec codec, int count) CPUTF8[]
parseCPUTF8References
(String name, InputStream in, BHSDCodec codec, int count) CPUTF8[][]
parseCPUTF8References
(String name, InputStream in, BHSDCodec codec, int[] counts) long[][]
parseFlags
(String name, InputStream in, int[] counts, BHSDCodec codec, boolean hasHi) long[][]
parseFlags
(String name, InputStream in, int[] counts, BHSDCodec hiCodec, BHSDCodec loCodec) long[]
parseFlags
(String name, InputStream in, int count, BHSDCodec codec, boolean hasHi) long[]
parseFlags
(String name, InputStream in, int count, BHSDCodec hiCodec, BHSDCodec loCodec) String[][]
parseReferences
(String name, InputStream in, BHSDCodec codec, int[] counts, String[] reference) Parses count references fromin
, usingcodec
to decode the values as indexes intoreference
(which is populated prior to this call).String[]
parseReferences
(String name, InputStream in, BHSDCodec codec, int count, String[] reference) Parses count references fromin
, usingcodec
to decode the values as indexes intoreference
(which is populated prior to this call).abstract void
read
(InputStream inputStream) abstract void
unpack()
void
unpack
(InputStream in)
-
Field Details
-
segment
-
header
-
-
Constructor Details
-
BandSet
-
-
Method Details
-
decodeBandInt
public int[] decodeBandInt(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception Decodes 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 fromcodec
- the default Codec for this bandcount
- the number of elements to read- Returns:
- an array of decoded
int
values - Throws:
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(String name, InputStream in, BHSDCodec defaultCodec, int[] counts) throws IOException, Pack200Exception Decodes 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:
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
-
getReferences
-
parseCPClassReferences
public CPClass[] parseCPClassReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPDescriptorReferences
public CPNameAndType[] parseCPDescriptorReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPDoubleReferences
public CPDouble[] parseCPDoubleReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPFieldRefReferences
public CPFieldRef[] parseCPFieldRefReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPFloatReferences
public CPFloat[] parseCPFloatReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPInterfaceMethodRefReferences
public CPInterfaceMethodRef[] parseCPInterfaceMethodRefReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPIntReferences
public CPInteger[] parseCPIntReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPLongReferences
public CPLong[] parseCPLongReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPMethodRefReferences
public CPMethodRef[] parseCPMethodRefReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPSignatureReferences
public CPUTF8[] parseCPSignatureReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPSignatureReferences
protected CPUTF8[][] parseCPSignatureReferences(String name, InputStream in, BHSDCodec codec, int[] counts) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPStringReferences
public CPString[] parseCPStringReferences(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPUTF8References
public CPUTF8[] parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int count) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseCPUTF8References
public CPUTF8[][] parseCPUTF8References(String name, InputStream in, BHSDCodec codec, int[] counts) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseFlags
public long[] parseFlags(String name, InputStream in, int count, BHSDCodec hiCodec, BHSDCodec loCodec) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseFlags
public long[] parseFlags(String name, InputStream in, int count, BHSDCodec codec, boolean hasHi) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseFlags
public long[][] parseFlags(String name, InputStream in, int[] counts, BHSDCodec hiCodec, BHSDCodec loCodec) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseFlags
public long[][] parseFlags(String name, InputStream in, int[] counts, BHSDCodec codec, boolean hasHi) throws IOException, Pack200Exception - Throws:
IOException
Pack200Exception
-
parseReferences
public String[] parseReferences(String name, InputStream in, BHSDCodec codec, int count, String[] reference) throws IOException, Pack200Exception Parses count references fromin
, usingcodec
to 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:
IOException
- if a problem occurs during reading from the underlying streamPack200Exception
- if a problem occurs with an unexpected value or unsupported Codec
-
parseReferences
public String[][] parseReferences(String name, InputStream in, BHSDCodec codec, int[] counts, String[] reference) throws IOException, Pack200Exception Parses count references fromin
, usingcodec
to 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:
IOException
- if a problem occurs during reading from the underlying streamPack200Exception
- if a problem occurs with an unexpected value or unsupported Codec
-
read
- Throws:
IOException
Pack200Exception
-
unpack
- Throws:
IOException
Pack200Exception
-
unpack
- Throws:
IOException
Pack200Exception
-