java.lang.Object
org.apache.commons.compress.harmony.unpack200.Segment

public class Segment extends Object
A Pack200 archive consists of one or more segments. Each segment is stand-alone, in the sense that every segment has the magic number header; thus, every segment is also a valid archive. However, it is possible to combine (non-GZipped) archives into a single large archive by concatenation alone. Thus, all the hard work in unpacking an archive falls to understanding a segment. The first component of a segment is the header; this contains (amongst other things) the expected counts of constant pool entries, which in turn defines how many values need to be read from the stream. Because values are variable width (see 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.