public class GzipHeader
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
GzipHeader()
Shutdown constructor.
|
GzipHeader(java.io.InputStream in)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final int MINIMAL_GZIP_HEADER_LENGTH
protected int length
protected int flg
public GzipHeader()
public GzipHeader(java.io.InputStream in)
throws java.io.IOException
in - InputStream to read from.java.io.IOExceptionpublic 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.IOExceptionpublic 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.IOExceptionprotected int readByte(java.io.InputStream in)
throws java.io.IOException
in - InputStream to read.java.io.IOExceptionprotected 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.IOExceptionprotected 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.IOExceptionpublic byte[] getFextra()
public int getFlg()
public int getOs()
public int getXfl()
public int getMtime()
public int getLength()
Copyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.