public abstract class BandSet extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
BandSet.BandAnalysisResults
Results obtained by trying different Codecs to encode a band
|
class |
BandSet.BandData
BandData represents information about a band, e.g.
|
Modifier and Type | Field and Description |
---|---|
protected SegmentHeader |
segmentHeader |
Constructor and Description |
---|
BandSet(int effort,
SegmentHeader header)
Create a new BandSet
|
Modifier and Type | Method and Description |
---|---|
protected int[] |
cpEntryListToArray(java.util.List list)
Converts a list of ConstantPoolEntrys to an int[] array of their indices
|
protected int[] |
cpEntryOrNullListToArray(java.util.List theList)
Converts a list of ConstantPoolEntrys or nulls to an int[] array of their indices +1 (or 0 for nulls)
|
byte[] |
encodeBandInt(java.lang.String name,
int[] ints,
BHSDCodec defaultCodec)
Encode a band of integers.
|
protected byte[] |
encodeFlags(java.lang.String name,
long[][] flags,
BHSDCodec loCodec,
BHSDCodec hiCodec,
boolean haveHiFlags) |
protected byte[] |
encodeFlags(java.lang.String name,
long[] flags,
BHSDCodec loCodec,
BHSDCodec hiCodec,
boolean haveHiFlags)
Encode a band of longs (values are split into their high and low 32 bits and then encoded as two separate bands
|
byte[] |
encodeScalar(int[] band,
BHSDCodec codec)
Encode a band without considering other Codecs
|
byte[] |
encodeScalar(int value,
BHSDCodec codec)
Encode a single value with the given Codec
|
protected int[] |
integerListToArray(java.util.List integerList)
Converts a list of Integers to an int[] array.
|
protected long[] |
longListToArray(java.util.List longList)
Converts a list of Longs to an long[] array.
|
abstract void |
pack(java.io.OutputStream out)
Write the packed set of bands to the given output stream
|
protected final SegmentHeader segmentHeader
public BandSet(int effort, SegmentHeader header)
effort
- - the packing effort to be used (must be 1-9)header
- - the segment headerpublic abstract void pack(java.io.OutputStream out) throws java.io.IOException, Pack200Exception
out
- TODOjava.io.IOException
- If an I/O error occurs.Pack200Exception
- TODOpublic byte[] encodeScalar(int[] band, BHSDCodec codec) throws Pack200Exception
band
- - the bandcodec
- - the Codec to usePack200Exception
- TODOpublic byte[] encodeScalar(int value, BHSDCodec codec) throws Pack200Exception
value
- - the value to encodecodec
- - Codec to usePack200Exception
- TODOpublic byte[] encodeBandInt(java.lang.String name, int[] ints, BHSDCodec defaultCodec) throws Pack200Exception
name
- - name of the band (used for debugging)ints
- - the banddefaultCodec
- - the default CodecPack200Exception
- TODOprotected byte[] encodeFlags(java.lang.String name, long[] flags, BHSDCodec loCodec, BHSDCodec hiCodec, boolean haveHiFlags) throws Pack200Exception
name
- - name of the band (for debugging purposes)flags
- - the bandloCodec
- - Codec for the low 32-bits bandhiCodec
- - Codec for the high 32-bits bandhaveHiFlags
- - ignores the high band if true as all values would be zeroPack200Exception
- TODOprotected int[] integerListToArray(java.util.List integerList)
integerList
- conversion source.protected long[] longListToArray(java.util.List longList)
longList
- conversion source.protected int[] cpEntryListToArray(java.util.List list)
list
- conversion source.protected int[] cpEntryOrNullListToArray(java.util.List theList)
theList
- conversion source.protected byte[] encodeFlags(java.lang.String name, long[][] flags, BHSDCodec loCodec, BHSDCodec hiCodec, boolean haveHiFlags) throws Pack200Exception
Pack200Exception