Package com.helger.commons.codec
Class LZWCodec
- java.lang.Object
-
- com.helger.commons.codec.LZWCodec
-
- All Implemented Interfaces:
IByteArrayCodec,IByteArrayDecoder,IByteArrayEncoder,IByteArrayStreamDecoder,IByteArrayStreamEncoder,ICodec<byte[]>,IDecoder<byte[],byte[]>,IEncoder<byte[],byte[]>
public class LZWCodec extends Object implements IByteArrayCodec
Encoder and decoder for the LZW algorithm- Author:
- Philip Helger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classLZWCodec.AbstractLZWDictionaryprotected static classLZWCodec.LZWDecodeDictionaryprotected static classLZWCodec.LZWEncodeDictionaryprotected static classLZWCodec.LZWNodeA single LZW node
-
Constructor Summary
Constructors Constructor Description LZWCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecode(byte[] aEncodedBuffer, int nOfs, int nLen, OutputStream aOS)Decode (part of) a byte array.voiddecode(InputStream aEncodedIS, OutputStream aOS)voidencode(byte[] aBuffer, int nOfs, int nLen, OutputStream aOS)Encode (part of) a byte array to anOutputStream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.helger.commons.codec.IByteArrayDecoder
getDecoded, getDecoded, getMaximumDecodedLength
-
Methods inherited from interface com.helger.commons.codec.IByteArrayStreamDecoder
decode, getDecoded, getDecodedAsString, getDecodedAsString, getDecodedAsString, getDecodedAsString
-
Methods inherited from interface com.helger.commons.codec.IByteArrayStreamEncoder
encode, getEncoded, getEncoded, getEncoded, getEncodedAsString, getEncodedAsString, getEncodedAsString, getMaximumEncodedLength
-
-
-
-
Method Detail
-
encode
public void encode(@Nullable byte[] aBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
Description copied from interface:IByteArrayStreamEncoderEncode (part of) a byte array to anOutputStream.- Specified by:
encodein interfaceIByteArrayStreamEncoder- Parameters:
aBuffer- The byte array to be encoded. May benull.nOfs- Offset into the byte array to start from.nLen- Number of bytes starting from offset to consider.aOS- The output stream to write to. May not benulland is NOT closed afterwards!
-
decode
public void decode(@Nonnull @WillNotClose InputStream aEncodedIS, @Nonnull @WillNotClose OutputStream aOS)
-
decode
public void decode(@Nullable byte[] aEncodedBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
Description copied from interface:IByteArrayStreamDecoderDecode (part of) a byte array.- Specified by:
decodein interfaceIByteArrayStreamDecoder- Parameters:
aEncodedBuffer- The byte array to be decoded. May benull.nOfs- Offset into the byte array to start from.nLen- Number of bytes starting from offset to consider.aOS- The output stream to write to. May not benulland is NOT closed afterwards!
-
-