|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twelvemonkeys.io.enc.PackBitsDecoder
public final class PackBitsDecoder
Decoder implementation for Apple PackBits run-length encoding.
From Wikipedia, the free encyclopedia| Header byte | Data |
|---|---|
| 0 to 127 | 1 + n literal bytes of data |
| 0 to -127 | One byte of data, repeated 1 - n times in the decompressed output |
| -128 | No operation |
| Constructor Summary | |
|---|---|
PackBitsDecoder()
Creates a PackBitsDecoder. |
|
PackBitsDecoder(boolean pDisableNoop)
Creates a PackBitsDecoder, with optional compatibility mode. |
|
| Method Summary | |
|---|---|
int |
decode(java.io.InputStream stream,
java.nio.ByteBuffer buffer)
Decodes bytes from the given input stream, to the given buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PackBitsDecoder()
PackBitsDecoder.
public PackBitsDecoder(boolean pDisableNoop)
PackBitsDecoder, with optional compatibility mode.
As some implementations of PackBits-like encoders treat -128 as length of
a compressed run, instead of a no-op, it's possible to disable no-ops for compatibility.
Should be used with caution, even though, most known encoders never write no-ops in the compressed streams.
pDisableNoop - true if -128 should be treated as a compressed run, and not a no-op| Method Detail |
|---|
public int decode(java.io.InputStream stream,
java.nio.ByteBuffer buffer)
throws java.io.IOException
decode in interface Decoderstream - the stream to decode frombuffer - a byte array, minimum 128 (or 129 if no-op is disabled) bytes long
java.io.IOException
DecodeException - if encoded data is corrupt
java.io.EOFException - if a premature end-of-file is encountered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||