|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.util.Compression
public abstract class Compression
Characterises the compression status of a stream, and provides methods for decompressing it.
| Field Summary | |
|---|---|
static Compression |
BZIP2
A Compression object representing BZip2 compression. |
static Compression |
COMPRESS
A Compression object representing Unix compress-type compression. |
static Compression |
GZIP
A Compression object representing GZip compression. |
static int |
MAGIC_SIZE
Number of bytes needed to determine compression type (magic number). |
static Compression |
NONE
A Compression object representing no compression (or perhaps an unknown one). |
| Method Summary | |
|---|---|
abstract java.io.InputStream |
decompress(java.io.InputStream raw)
Returns a stream which is a decompressed version of the input stream, according to this objects compression type. |
static java.io.InputStream |
decompressStatic(java.io.InputStream raw)
Returns a decompressed version of the given input stream. |
static Compression |
getCompression(byte[] magic)
Returns a Compression object characterising the compression (if any) represented by a given magic number. |
java.lang.String |
toString()
Returns the name of this compression type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAGIC_SIZE
public static final Compression NONE
public static final Compression GZIP
public static final Compression BZIP2
public static final Compression COMPRESS
| Method Detail |
|---|
public abstract java.io.InputStream decompress(java.io.InputStream raw)
throws java.io.IOException
raw - the raw input stream
java.io.IOExceptionpublic static Compression getCompression(byte[] magic)
magic - a buffer containing the first MAGIC_SIZE
bytes of input of the stream to be characterised
java.lang.IllegalArgumentException - if magic.length<MAGIC_SIZE
public static java.io.InputStream decompressStatic(java.io.InputStream raw)
throws java.io.IOException
raw - the raw input stream
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||