Class Encoders


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

      Constructors 
      Constructor Description
      Encoders()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.netty.buffer.ByteBuf compress​(io.netty.buffer.ByteBuf src, boolean pooled)
      Encodes the given ByteBuf
      static void compress​(io.netty.buffer.ByteBuf src, io.netty.buffer.ByteBuf dst)
      Encodes the given ByteBuf
      static void compress​(io.netty.buffer.ByteBuf src, io.netty.buffer.ByteBuf dst, Encoder.Parameters params)
      Encodes the given ByteBuf
      static void compress​(java.nio.ByteBuffer src, java.nio.ByteBuffer dst)
      Encodes the given ByteBuffer
      static void compress​(java.nio.ByteBuffer src, java.nio.ByteBuffer dst, Encoder.Parameters params)
      Encodes the given ByteBuffer
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Encoders

        public Encoders()
    • Method Detail

      • compress

        public static io.netty.buffer.ByteBuf compress​(io.netty.buffer.ByteBuf src,
                                                       boolean pooled)
                                                throws java.io.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:
        java.io.IOException - Thrown in case of error during encoding
      • compress

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

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

        public static void compress​(java.nio.ByteBuffer src,
                                    java.nio.ByteBuffer dst,
                                    Encoder.Parameters params)
                             throws java.io.IOException
        Encodes the given ByteBuffer
        Parameters:
        src - ByteBuffer source
        dst - ByteBuffer destination
        params - Encoder.Parameters instance
        Throws:
        java.io.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 java.io.IOException
        Encodes the given ByteBuf
        Parameters:
        src - ByteBuffer source
        dst - ByteBuffer destination
        params - Encoder.Parameters instance
        Throws:
        java.io.IOException - Thrown in case of error during encoding