|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.archive.io.GzipHeader
public class GzipHeader
Read in the GZIP header. See RFC1952 for specification on what the header looks like. Assumption is that stream is cued-up with the gzip header as the next thing to be read.
Of Java and unsigned bytes. That is, its always a signed int in java no matter what the qualifier whether byte, char, etc.
Add accessors for optional filename, comment and MTIME.
Field Summary | |
---|---|
protected int |
flg
The GZIP header FLG byte. |
protected int |
length
Total length of the gzip header. |
static int |
MINIMAL_GZIP_HEADER_LENGTH
Length of minimal GZIP header. |
Constructor Summary | |
---|---|
GzipHeader()
Shutdown constructor. |
|
GzipHeader(java.io.InputStream in)
Constructor. |
Method Summary | |
---|---|
byte[] |
getFextra()
|
int |
getFlg()
|
int |
getLength()
|
int |
getMtime()
|
int |
getOs()
|
int |
getXfl()
|
protected int |
readByte(java.io.InputStream in)
Read a byte. |
protected int |
readByte(java.io.InputStream in,
java.util.zip.CRC32 crc)
Read a byte. |
protected int |
readByte(java.io.InputStream in,
java.util.zip.CRC32 crc,
byte[] buffer,
int offset,
int length)
Read a byte. |
void |
readHeader(java.io.InputStream in)
Read in gzip header. |
boolean |
testGzipMagic(java.io.InputStream in)
Test gzip magic is next in the stream. |
boolean |
testGzipMagic(java.io.InputStream in,
java.util.zip.CRC32 crc)
Test gzip magic is next in the stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MINIMAL_GZIP_HEADER_LENGTH
protected int length
protected int flg
Constructor Detail |
---|
public GzipHeader()
public GzipHeader(java.io.InputStream in) throws java.io.IOException
in
- InputStream to read from.
java.io.IOException
Method Detail |
---|
public void readHeader(java.io.InputStream in) throws java.io.IOException
in
- InputStream.
java.io.IOException
- Throws if does not start with GZIP Header.public boolean testGzipMagic(java.io.InputStream in) throws java.io.IOException
in
- InputStream to read.
java.io.IOException
public boolean testGzipMagic(java.io.InputStream in, java.util.zip.CRC32 crc) throws java.io.IOException
in
- InputStream to read.crc
- CRC to update.
java.io.IOException
protected int readByte(java.io.InputStream in) throws java.io.IOException
in
- InputStream to read.
java.io.IOException
protected int readByte(java.io.InputStream in, java.util.zip.CRC32 crc) throws java.io.IOException
in
- InputStream to read.crc
- CRC to update.
java.io.IOException
protected int readByte(java.io.InputStream in, java.util.zip.CRC32 crc, byte[] buffer, int offset, int length) throws java.io.IOException
in
- InputStream to read.crc
- CRC to update.buffer
- Buffer to read into.offset
- Offset to start filling buffer at.length
- How much to read.
java.io.IOException
public byte[] getFextra()
public int getFlg()
public int getOs()
public int getXfl()
public int getMtime()
public int getLength()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |