Interface CompressionCodec

All Known Implementing Classes:
CompressionUtils.CommonsCompressGzipCompressionCodec, CompressionUtils.CommonsCompressLz4CompressionCodec, CompressionUtils.CommonsCompressSnappyCompressionCodec, CompressionUtils.CommonsCompressZstdCompressionCodec, CompressionUtils.GzipCompressionCodec, CompressionUtils.Lz4JavaCompressionCodec, CompressionUtils.XerialSnappyCompressionCodec, CompressionUtils.ZstdJniCompressionCodec

public interface CompressionCodec
Codec to compress and decompress sub-entries.
  • Method Details

    • maxCompressedLength

      int maxCompressedLength(int sourceLength)
      Provides the maximum compressed size from the source length.
      Parameters:
      sourceLength - size of plain, uncompressed data
      Returns:
      maximum compressed size
    • compress

      OutputStream compress(OutputStream target)
      Creates an OutputStream to compress data.
      Parameters:
      target - the stream where compressed data will end up
      Returns:
      output stream to write plain data to
    • decompress

      InputStream decompress(InputStream source)
      Creates an InputStream to read decompressed data from.
      Parameters:
      source - the stream to read compressed data from
      Returns:
      input stream to read decompressed data from
    • code

      byte code()
      Return the code for this type of codec.
      Returns:
      compression code