Top Description Fields Constructors Methods
org.apache.commons.compress.harmony.unpack200

public abstract Class BandSet

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.commons.compress.harmony.unpack200.BcBands, org.apache.commons.compress.harmony.unpack200.ClassBands, org.apache.commons.compress.harmony.unpack200.CpBands, org.apache.commons.compress.harmony.unpack200.FileBands, org.apache.commons.compress.harmony.unpack200.IcBands, org.apache.commons.compress.harmony.unpack200.NewAttributeBands, org.apache.commons.compress.harmony.unpack200.AttrDefinitionBands
Imports
java.io.IOException, .InputStream, java.util.Arrays, org.apache.commons.compress.harmony.pack200.BHSDCodec, .Codec, .CodecEncoding, .Pack200Exception, .PopulationCodec, org.apache.commons.compress.harmony.unpack200.bytecode.CPClass, .CPDouble, .CPFieldRef, .CPFloat, .CPInteger, .CPInterfaceMethodRef, .CPLong, .CPMethodRef, .CPNameAndType, .CPString, .CPUTF8, org.apache.commons.compress.utils.ExactMath

Abstract superclass for a set of bands.

Field Summary

Modifier and TypeField and Description
protected SegmentHeader
protected Segment

Constructor Summary

AccessConstructor and Description
public
BandSet(final Segment segment)

Method Summary

Modifier and TypeMethod and Description
public int[]

Returns:

an array of decoded int values
decodeBandInt
(final String
the name of the band (primarily for logging/debugging purposes)
name
,
final InputStream
the InputStream to decode from
in
,
final BHSDCodec
the default Codec for this band
codec
,
final int
the number of elements to read
count
)

Decodes a band and return an array of int values.

public int[][]

Returns:

an array of decoded int[] values
decodeBandInt
(final String
the name of the band (primarily for logging/debugging purposes)
name
,
final InputStream
the InputStream to decode from
in
,
final BHSDCodec
the default codec for this band
defaultCodec
,
final int[]
the numbers of elements to read for each int array within the array to be returned
counts
)

Decodes a band and return an array of int[] values.

protected String[]
getReferences(final int[] ints, final String[] reference)

protected String[][]
getReferences(final int[][] ints, final String[] reference)

public CPClass[]
parseCPClassReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPNameAndType[]
parseCPDescriptorReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPDouble[]
parseCPDoubleReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPFieldRef[]
parseCPFieldRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPFloat[]
parseCPFloatReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPInterfaceMethodRef[]
parseCPInterfaceMethodRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPInteger[]
parseCPIntReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPLong[]
parseCPLongReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPMethodRef[]
parseCPMethodRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPUTF8[]
parseCPSignatureReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

protected CPUTF8[][]
parseCPSignatureReferences(final String name, final InputStream in, final BHSDCodec codec, final int[] counts)

public CPString[]
parseCPStringReferences(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPUTF8[]
parseCPUTF8References(final String name, final InputStream in, final BHSDCodec codec, final int count)

public CPUTF8[][]
parseCPUTF8References(final String name, final InputStream in, final BHSDCodec codec, final int[] counts)

public long[]
parseFlags(final String name, final InputStream in, final int count, final BHSDCodec hiCodec, final BHSDCodec loCodec)

public long[]
parseFlags(final String name, final InputStream in, final int count, final BHSDCodec codec, final boolean hasHi)

public long[][]
parseFlags(final String name, final InputStream in, final int[] counts, final BHSDCodec hiCodec, final BHSDCodec loCodec)

public long[][]
parseFlags(final String name, final InputStream in, final int[] counts, final BHSDCodec codec, final boolean hasHi)

public String[]

Returns:

Parsed references.
parseReferences
(final String
the band name
name
,
final InputStream
the input stream to read from
in
,
final BHSDCodec
the BHSDCodec to use for decoding
codec
,
final int
the number of references to decode
count
,
final String[]
the array of values to use for the references
reference
)

Parses count references from in, using codec to decode the values as indexes into reference (which is populated prior to this call).

public String[][]

Returns:

Parsed references.
parseReferences
(final String
TODO
name
,
final InputStream
the input stream to read from
in
,
final BHSDCodec
the BHSDCodec to use for decoding
codec
,
final int[]
the numbers of references to decode for each array entry
counts
,
final String[]
the array of values to use for the references
reference
)

Parses count references from in, using codec to decode the values as indexes into reference (which is populated prior to this call).

public abstract void
read(InputStream inputStream)

public abstract void
public void
unpack(final InputStream in)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

segmentback to summary
protected Segment segment

Constructor Detail

BandSetback to summary
public BandSet(final Segment segment)

Method Detail

decodeBandIntback to summary
public int[] decodeBandInt(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception

Decodes a band and return an array of int values.

Parameters
name:String

the name of the band (primarily for logging/debugging purposes)

in:InputStream

the InputStream to decode from

codec:BHSDCodec

the default Codec for this band

count:int

the number of elements to read

Returns:int[]

an array of decoded int values

Exceptions
IOException:
if there is a problem reading from the underlying input stream
Pack200Exception:
if there is a problem decoding the value or that the value is invalid
decodeBandIntback to summary
public int[][] decodeBandInt(final String name, final InputStream in, final BHSDCodec defaultCodec, final int[] counts) throws IOException, Pack200Exception

Decodes a band and return an array of int[] values.

Parameters
name:String

the name of the band (primarily for logging/debugging purposes)

in:InputStream

the InputStream to decode from

defaultCodec:BHSDCodec

the default codec for this band

counts:int[]

the numbers of elements to read for each int array within the array to be returned

Returns:int[][]

an array of decoded int[] values

Exceptions
IOException:
if there is a problem reading from the underlying input stream
Pack200Exception:
if there is a problem decoding the value or that the value is invalid
getReferencesback to summary
protected String[] getReferences(final int[] ints, final String[] reference)
getReferencesback to summary
protected String[][] getReferences(final int[][] ints, final String[] reference)
parseCPClassReferencesback to summary
public CPClass[] parseCPClassReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPDescriptorReferencesback to summary
public CPNameAndType[] parseCPDescriptorReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPDoubleReferencesback to summary
public CPDouble[] parseCPDoubleReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPFieldRefReferencesback to summary
public CPFieldRef[] parseCPFieldRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPFloatReferencesback to summary
public CPFloat[] parseCPFloatReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPInterfaceMethodRefReferencesback to summary
public CPInterfaceMethodRef[] parseCPInterfaceMethodRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPIntReferencesback to summary
public CPInteger[] parseCPIntReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPLongReferencesback to summary
public CPLong[] parseCPLongReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPMethodRefReferencesback to summary
public CPMethodRef[] parseCPMethodRefReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPSignatureReferencesback to summary
public CPUTF8[] parseCPSignatureReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPSignatureReferencesback to summary
protected CPUTF8[][] parseCPSignatureReferences(final String name, final InputStream in, final BHSDCodec codec, final int[] counts) throws IOException, Pack200Exception
parseCPStringReferencesback to summary
public CPString[] parseCPStringReferences(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPUTF8Referencesback to summary
public CPUTF8[] parseCPUTF8References(final String name, final InputStream in, final BHSDCodec codec, final int count) throws IOException, Pack200Exception
parseCPUTF8Referencesback to summary
public CPUTF8[][] parseCPUTF8References(final String name, final InputStream in, final BHSDCodec codec, final int[] counts) throws IOException, Pack200Exception
parseFlagsback to summary
public long[] parseFlags(final String name, final InputStream in, final int count, final BHSDCodec hiCodec, final BHSDCodec loCodec) throws IOException, Pack200Exception
parseFlagsback to summary
public long[] parseFlags(final String name, final InputStream in, final int count, final BHSDCodec codec, final boolean hasHi) throws IOException, Pack200Exception
parseFlagsback to summary
public long[][] parseFlags(final String name, final InputStream in, final int[] counts, final BHSDCodec hiCodec, final BHSDCodec loCodec) throws IOException, Pack200Exception
parseFlagsback to summary
public long[][] parseFlags(final String name, final InputStream in, final int[] counts, final BHSDCodec codec, final boolean hasHi) throws IOException, Pack200Exception
parseReferencesback to summary
public String[] parseReferences(final String name, final InputStream in, final BHSDCodec codec, final int count, final String[] reference) throws IOException, Pack200Exception

Parses count references from in, using codec to decode the values as indexes into reference (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:String

the band name

in:InputStream

the input stream to read from

codec:BHSDCodec

the BHSDCodec to use for decoding

count:int

the number of references to decode

reference:String[]

the array of values to use for the references

Returns:String[]

Parsed references.

Exceptions
IOException:
if a problem occurs during reading from the underlying stream
Pack200Exception:
if a problem occurs with an unexpected value or unsupported Codec
parseReferencesback to summary
public String[][] parseReferences(final String name, final InputStream in, final BHSDCodec codec, final int[] counts, final String[] reference) throws IOException, Pack200Exception

Parses count references from in, using codec to decode the values as indexes into reference (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:String

TODO

in:InputStream

the input stream to read from

codec:BHSDCodec

the BHSDCodec to use for decoding

counts:int[]

the numbers of references to decode for each array entry

reference:String[]

the array of values to use for the references

Returns:String[][]

Parsed references.

Exceptions
IOException:
if a problem occurs during reading from the underlying stream
Pack200Exception:
if a problem occurs with an unexpected value or unsupported Codec
readback to summary
public abstract void read(InputStream inputStream) throws IOException, Pack200Exception
unpackback to summary
public abstract void unpack() throws IOException, Pack200Exception
unpackback to summary
public void unpack(final InputStream in) throws IOException, Pack200Exception