Class LZWCodec

java.lang.Object
com.helger.base.codec.impl.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
  • Constructor Details

    • LZWCodec

      public LZWCodec()
  • Method Details

    • encode

      public void encode(@Nullable byte[] aBuffer, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull @WillNotClose OutputStream aOS)
      Description copied from interface: IByteArrayStreamEncoder
      Encode (part of) a byte array to an OutputStream.
      Specified by:
      encode in interface IByteArrayStreamEncoder
      Parameters:
      aBuffer - The byte array to be encoded. May be null.
      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 be null and 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: IByteArrayStreamDecoder
      Decode (part of) a byte array.
      Specified by:
      decode in interface IByteArrayStreamDecoder
      Parameters:
      aEncodedBuffer - The byte array to be decoded. May be null.
      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 be null and is NOT closed afterwards!