Class CompressionCodecNone

java.lang.Object
org.apache.pulsar.common.compression.CompressionCodecNone
All Implemented Interfaces:
CompressionCodec

public class CompressionCodecNone extends Object implements CompressionCodec
No compression.
  • Constructor Details

    • CompressionCodecNone

      public CompressionCodecNone()
  • Method Details

    • encode

      public io.netty.buffer.ByteBuf encode(io.netty.buffer.ByteBuf raw)
      Description copied from interface: CompressionCodec
      Compress a buffer.
      Specified by:
      encode in interface CompressionCodec
      Parameters:
      raw - a buffer with the uncompressed content. The reader/writer indexes will not be modified
      Returns:
      a new buffer with the compressed content. The buffer needs to be released by the receiver
    • decode

      public io.netty.buffer.ByteBuf decode(io.netty.buffer.ByteBuf encoded, int uncompressedSize) throws IOException
      Description copied from interface: CompressionCodec
      Decompress a buffer.

      The buffer needs to have been compressed with the matching Encoder.

      Specified by:
      decode in interface CompressionCodec
      Parameters:
      encoded - the compressed content
      uncompressedSize - the size of the original content
      Returns:
      a ByteBuf with the compressed content. The buffer needs to be released by the receiver
      Throws:
      IOException - if the decompression fails