Class Encoders

java.lang.Object
com.aayushatharva.brotli4j.encoder.Encoders

public final class Encoders extends Object
Multiple encoding methods using Netty Buffer Make sure to add it as dependency before using this class
See Also:
  • Constructor Details

    • Encoders

      public Encoders()
  • Method Details

    • compress

      public static io.netty.buffer.ByteBuf compress(io.netty.buffer.ByteBuf src, boolean pooled) throws IOException
      Encodes the given ByteBuf
      Parameters:
      src - ByteBuf source
      pooled - If set to true then this method will return PooledDirectByteBuf else UnpooledDirectByteBuf
      Returns:
      If pooled is set to true then this method will return PooledDirectByteBuf else UnpooledDirectByteBuf
      Throws:
      IOException - Thrown in case of error during encoding
    • compress

      public static void compress(io.netty.buffer.ByteBuf src, io.netty.buffer.ByteBuf dst) throws IOException
      Encodes the given ByteBuf
      Parameters:
      src - ByteBuf source
      dst - ByteBuf destination
      Throws:
      IOException - Thrown in case of error during encoding
    • compress

      public static void compress(ByteBuffer src, ByteBuffer dst) throws IOException
      Encodes the given ByteBuffer
      Parameters:
      src - ByteBuffer source
      dst - ByteBuffer destination
      Throws:
      IOException - Thrown in case of error during encoding
    • compress

      public static void compress(ByteBuffer src, ByteBuffer dst, Encoder.Parameters params) throws IOException
      Encodes the given ByteBuffer
      Parameters:
      src - ByteBuffer source
      dst - ByteBuffer destination
      params - Encoder.Parameters instance
      Throws:
      IOException - Thrown in case of error during encoding
    • compress

      public static void compress(io.netty.buffer.ByteBuf src, io.netty.buffer.ByteBuf dst, Encoder.Parameters params) throws IOException
      Encodes the given ByteBuf
      Parameters:
      src - ByteBuffer source
      dst - ByteBuffer destination
      params - Encoder.Parameters instance
      Throws:
      IOException - Thrown in case of error during encoding