Class BufferUtils


  • public final class BufferUtils
    extends Object
    • Field Detail

      • BINARY_PREFIX

        public static final byte[] BINARY_PREFIX
      • STRING_PREFIX

        public static final byte[] STRING_PREFIX
    • Constructor Detail

      • BufferUtils

        public BufferUtils()
    • Method Detail

      • skipLengthEncode

        public static void skipLengthEncode​(io.netty.buffer.ByteBuf buf)
      • readLengthEncodedInt

        public static long readLengthEncodedInt​(io.netty.buffer.ByteBuf buf)
      • readLengthEncodedString

        public static String readLengthEncodedString​(io.netty.buffer.ByteBuf buf)
      • readLengthEncodedBuffer

        public static io.netty.buffer.ByteBuf readLengthEncodedBuffer​(io.netty.buffer.ByteBuf buf)
      • encodeLength

        public static byte[] encodeLength​(int length)
      • writeLengthEncode

        public static void writeLengthEncode​(String val,
                                             io.netty.buffer.ByteBuf buf)
      • encodeByte

        public static io.netty.buffer.ByteBuf encodeByte​(io.netty.buffer.ByteBufAllocator allocator,
                                                         int value)
      • encodeAscii

        public static io.netty.buffer.ByteBuf encodeAscii​(io.netty.buffer.ByteBufAllocator allocator,
                                                          String value)
      • encodeLengthAscii

        public static io.netty.buffer.ByteBuf encodeLengthAscii​(io.netty.buffer.ByteBufAllocator allocator,
                                                                String value)
      • encodeLengthUtf8

        public static io.netty.buffer.ByteBuf encodeLengthUtf8​(io.netty.buffer.ByteBufAllocator allocator,
                                                               String value)
      • encodeLengthBytes

        public static io.netty.buffer.ByteBuf encodeLengthBytes​(io.netty.buffer.ByteBufAllocator allocator,
                                                                byte[] value)
      • encodeEscapedBuffer

        public static io.netty.buffer.ByteBuf encodeEscapedBuffer​(io.netty.buffer.ByteBufAllocator allocator,
                                                                  io.netty.buffer.ByteBuf value,
                                                                  Context context)
      • encodeEscapedBytes

        public static io.netty.buffer.ByteBuf encodeEscapedBytes​(io.netty.buffer.ByteBufAllocator allocator,
                                                                 byte[] prefix,
                                                                 byte[] value,
                                                                 Context context)
      • escapedBytes

        public static void escapedBytes​(io.netty.buffer.ByteBuf buf,
                                        byte[] value,
                                        int len,
                                        Context context)
      • toString

        public static String toString​(io.netty.buffer.ByteBuf packet)