public class Segment extends Object
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 |
---|---|
static int |
LOG_LEVEL_QUIET |
static int |
LOG_LEVEL_STANDARD |
static int |
LOG_LEVEL_VERBOSE |
Constructor and Description |
---|
Segment() |
Modifier and Type | Method and Description |
---|---|
protected AttrDefinitionBands |
getAttrDefinitionBands() |
protected ClassBands |
getClassBands() |
SegmentConstantPool |
getConstantPool() |
protected CpBands |
getCpBands() |
protected IcBands |
getIcBands() |
SegmentHeader |
getSegmentHeader() |
void |
log(int logLevel,
String message) |
void |
overrideDeflateHint(boolean deflateHint)
Override the archive's deflate hint with the given boolean
|
void |
setLogLevel(int logLevel) |
void |
setLogStream(OutputStream logStream) |
void |
setPreRead(boolean value) |
void |
unpack(InputStream in,
JarOutputStream out)
Unpacks a packed stream (either .pack.
|
void |
writeJar(JarOutputStream out)
Writes the segment to an output stream.
|
public static final int LOG_LEVEL_VERBOSE
public static final int LOG_LEVEL_STANDARD
public static final int LOG_LEVEL_QUIET
public Segment()
protected AttrDefinitionBands getAttrDefinitionBands()
protected ClassBands getClassBands()
public SegmentConstantPool getConstantPool()
protected CpBands getCpBands()
protected IcBands getIcBands()
public SegmentHeader getSegmentHeader()
public void overrideDeflateHint(boolean deflateHint)
deflateHint
- - the deflate hint to usepublic void setLogLevel(int logLevel)
public void setLogStream(OutputStream logStream)
public void setPreRead(boolean value)
public void unpack(InputStream in, JarOutputStream out) throws IOException, Pack200Exception
in
- a packed stream.out
- output stream.Pack200Exception
- if there is a problem unpackingIOException
- if there is a problem with I/O during unpackingpublic void writeJar(JarOutputStream out) throws IOException
out
- the JarOutputStream to write data toIOException
- if an error occurs while reading or writing to the streamsCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.