Codec), it is not possible to calculate the start of the next
segment, although one of the header values does hint at the size of the segment if non-zero, which can be used for buffering purposes.
Note that this does not perform any buffering of the input stream; each value will be read on a byte-by-byte basis. It does not perform GZip decompression
automatically; both of these are expected to be done by the caller if the stream has the magic header for GZip streams (GZIPInputStream#GZIP_MAGIC).
In any case, if GZip decompression is being performed the input stream will be buffered at a higher level, and thus this can read on a byte-oriented basis.
| Modifier and Type | Field and Description |
|---|---|
| private AttrDefinitionBands | |
| private BcBands | |
| private ClassBands | |
| private byte[][] | |
| private CpBands | |
| private boolean | |
| private boolean | |
| private FileBands | |
| private boolean[] | |
| private boolean[] | |
| private SegmentHeader | |
| private IcBands | |
| private InputStream | |
| public static final int | |
| public static final int | |
| public static final int | |
| private int | |
| private PrintWriter | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ClassFile | |
| private List | Returns: List of tuples to be stored. If ic_local is null or empty, the values returned may not be correct. The caller will have to determine if this is the case.IcTuple[] array of local transmitted tuples icLocal, final IcTuple[] IcTuple[] array of relevant tuples icRelevant)Given an ic_local and an ic_relevant, use them to calculate what should be added as ic_stored. |
| protected AttrDefinitionBands | |
| protected ClassBands | |
| public SegmentConstantPool | |
| protected CpBands | |
| protected IcBands | |
| public SegmentHeader | |
| public void | |
| public void | overrideDeflateHint(final boolean
- the deflate hint to use deflateHint)Override the archive's deflate hint with the given boolean |
| private void | |
| private void | readSegment(final InputStream
the input stream to read from in)This performs reading the data from the stream into non-static instance of Segment. |
| public void | |
| public void | |
| public void | |
| public void | unpack(final InputStream
a packed input stream, preferably a inputStream, final JarOutputStream BoundedInputStream.output stream. out)Unpacks a packed stream (either .pack. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | writeJar(final JarOutputStream
the JarOutputStream to write data to out)Writes the segment to an output stream. |
| attrDefinitionBands | back to summary |
|---|---|
| private AttrDefinitionBands attrDefinitionBands | |
| bcBands | back to summary |
|---|---|
| private BcBands bcBands | |
| classBands | back to summary |
|---|---|
| private ClassBands classBands | |
| classFilesContents | back to summary |
|---|---|
| private byte[][] classFilesContents | |
| cpBands | back to summary |
|---|---|
| private CpBands cpBands | |
| deflateHint | back to summary |
|---|---|
| private boolean deflateHint | |
| doPreRead | back to summary |
|---|---|
| private boolean doPreRead | |
| fileBands | back to summary |
|---|---|
| private FileBands fileBands | |
| fileDeflate | back to summary |
|---|---|
| private boolean[] fileDeflate | |
| fileIsClass | back to summary |
|---|---|
| private boolean[] fileIsClass | |
| header | back to summary |
|---|---|
| private SegmentHeader header | |
| icBands | back to summary |
|---|---|
| private IcBands icBands | |
| internalBuffer | back to summary |
|---|---|
| private InputStream internalBuffer | |
| LOG_LEVEL_QUIET | back to summary |
|---|---|
| public static final int LOG_LEVEL_QUIET | |
| LOG_LEVEL_STANDARD | back to summary |
|---|---|
| public static final int LOG_LEVEL_STANDARD | |
| LOG_LEVEL_VERBOSE | back to summary |
|---|---|
| public static final int LOG_LEVEL_VERBOSE | |
| logLevel | back to summary |
|---|---|
| private int logLevel | |
| logStream | back to summary |
|---|---|
| private PrintWriter logStream | |
| overrideDeflateHint | back to summary |
|---|---|
| private boolean overrideDeflateHint | |
| Segment | back to summary |
|---|---|
| public Segment() | |
| buildClassFile | back to summary |
|---|---|
| private ClassFile buildClassFile(final int classNum) | |
| computeIcStored | back to summary |
|---|---|
| private List Given an ic_local and an ic_relevant, use them to calculate what should be added as ic_stored. | |
| getAttrDefinitionBands | back to summary |
|---|---|
| protected AttrDefinitionBands getAttrDefinitionBands() | |
| getClassBands | back to summary |
|---|---|
| protected ClassBands getClassBands() | |
| getConstantPool | back to summary |
|---|---|
| public SegmentConstantPool getConstantPool() | |
| getCpBands | back to summary |
|---|---|
| protected CpBands getCpBands() | |
| getIcBands | back to summary |
|---|---|
| protected IcBands getIcBands() | |
| getSegmentHeader | back to summary |
|---|---|
| public SegmentHeader getSegmentHeader() | |
| log | back to summary |
|---|---|
| public void log(final int logLevel, final String message) | |
| overrideDeflateHint | back to summary |
|---|---|
| public void overrideDeflateHint(final boolean deflateHint) Override the archive's deflate hint with the given boolean
| |
| parseSegment | back to summary |
|---|---|
| private void parseSegment() throws IOException, Pack200Exception This performs the actual work of parsing against a non-static instance of Segment. This method is intended to run concurrently for multiple segments.
| |
| readSegment | back to summary |
|---|---|
| private void readSegment(final InputStream in) throws IOException, Pack200Exception This performs reading the data from the stream into non-static instance of Segment. After the completion of this method stream can be freed.
| |
| setLogLevel | back to summary |
|---|---|
| public void setLogLevel(final int logLevel) | |
| setLogStream | back to summary |
|---|---|
| public void setLogStream(final OutputStream logStream) | |
| setPreRead | back to summary |
|---|---|
| public void setPreRead(final boolean value) | |
| unpack | back to summary |
|---|---|
| public void unpack(final InputStream inputStream, final JarOutputStream out) throws IOException, Pack200Exception Unpacks a packed stream (either .pack. or .pack.gz) into a corresponding JarOuputStream.
| |
| unpackProcess | back to summary |
|---|---|
| pack-priv void unpackProcess() throws IOException, Pack200Exception | |
| unpackRead | back to summary |
|---|---|
| pack-priv void unpackRead(final InputStream inputStream) throws IOException, Pack200Exception | |
| unpackWrite | back to summary |
|---|---|
| pack-priv void unpackWrite(final JarOutputStream out) throws IOException | |
| writeJar | back to summary |
|---|---|
| public void writeJar(final JarOutputStream out) throws IOException Writes the segment to an output stream. The output stream should be pre-buffered for efficiency. Also takes the same input stream for reading, since the file bits may not be loaded and thus just copied from one stream to another. Doesn't close the output stream when finished, in case there are more entries (e.g. further segments) to be written.
| |