Class ExtendedByteBuf


  • public class ExtendedByteBuf
    extends Object
    • Constructor Detail

      • ExtendedByteBuf

        public ExtendedByteBuf()
    • Method Detail

      • wrappedBuffer

        public static io.netty.buffer.ByteBuf wrappedBuffer​(byte[]... arrays)
      • buffer

        public static io.netty.buffer.ByteBuf buffer​(int capacity)
      • dynamicBuffer

        public static io.netty.buffer.ByteBuf dynamicBuffer()
      • readUnsignedShort

        public static int readUnsignedShort​(io.netty.buffer.ByteBuf bf)
      • readUnsignedInt

        public static int readUnsignedInt​(io.netty.buffer.ByteBuf bf)
      • readUnsignedLong

        public static long readUnsignedLong​(io.netty.buffer.ByteBuf bf)
      • readRangedBytes

        public static byte[] readRangedBytes​(io.netty.buffer.ByteBuf bf)
      • readRangedBytes

        public static byte[] readRangedBytes​(io.netty.buffer.ByteBuf bf,
                                             int length)
      • readOptRangedBytes

        public static Optional<byte[]> readOptRangedBytes​(io.netty.buffer.ByteBuf bf)
        Reads optional range of bytes. Negative lengths are translated to None, 0 length represents empty Array
      • readOptString

        public static Optional<String> readOptString​(io.netty.buffer.ByteBuf bf)
        Reads an optional String. 0 length is an empty string, negative length is translated to None.
      • readString

        public static String readString​(io.netty.buffer.ByteBuf bf)
        Reads length of String and then returns an UTF-8 formatted String of such length. If the length is 0, an empty String is returned.
      • readMaybeByte

        public static Optional<Byte> readMaybeByte​(io.netty.buffer.ByteBuf bf)
        Reads a byte if possible. If not present the reader index is reset to the last mark.
        Parameters:
        bf -
        Returns:
      • readMaybeLong

        public static Optional<Long> readMaybeLong​(io.netty.buffer.ByteBuf bf)
      • readMaybeVLong

        public static Optional<Long> readMaybeVLong​(io.netty.buffer.ByteBuf bf)
        Reads a variable long if possible. If not present the reader index is reset to the last mark.
        Parameters:
        bf -
        Returns:
      • readMaybeVInt

        public static Optional<Integer> readMaybeVInt​(io.netty.buffer.ByteBuf bf)
        Reads a variable size int if possible. If not present the reader index is reset to the last mark.
        Parameters:
        bf -
        Returns:
      • readMaybeRangedBytes

        public static Optional<byte[]> readMaybeRangedBytes​(io.netty.buffer.ByteBuf bf)
        Reads a range of bytes if possible. If not present the reader index is reset to the last mark.
        Parameters:
        bf -
        Returns:
      • readMaybeRangedBytes

        public static Optional<byte[]> readMaybeRangedBytes​(io.netty.buffer.ByteBuf bf,
                                                            int length)
      • readMaybeSignedInt

        public static Optional<Integer> readMaybeSignedInt​(io.netty.buffer.ByteBuf bf)
      • readMaybeOptRangedBytes

        public static Optional<Optional<byte[]>> readMaybeOptRangedBytes​(io.netty.buffer.ByteBuf bf)
        Read a range of bytes prefixed by its length (encoded as a signed VInt).
        Returns:
        Optional(Optional(byte[]) if it could read the range, Optional(Optional.empty()) if the length was negative, or Optional.empty() if the input buffer didn't contain the entire range.
      • readMaybeString

        public static Optional<String> readMaybeString​(io.netty.buffer.ByteBuf bf)
        Reads a string if possible. If not present the reader index is reset to the last mark.
        Parameters:
        bf -
        Returns:
      • readMaybeOptString

        public static Optional<Optional<String>> readMaybeOptString​(io.netty.buffer.ByteBuf bf)
      • writeUnsignedShort

        public static void writeUnsignedShort​(int i,
                                              io.netty.buffer.ByteBuf bf)
      • writeUnsignedInt

        public static void writeUnsignedInt​(int i,
                                            io.netty.buffer.ByteBuf bf)
      • writeUnsignedLong

        public static void writeUnsignedLong​(long l,
                                             io.netty.buffer.ByteBuf bf)
      • writeRangedBytes

        public static void writeRangedBytes​(byte[] src,
                                            io.netty.buffer.ByteBuf bf)
      • writeRangedBytes

        public static void writeRangedBytes​(byte[] src,
                                            int offset,
                                            io.netty.buffer.ByteBuf bf)
      • writeRangedBytes

        public static void writeRangedBytes​(ByteBuffer src,
                                            io.netty.buffer.ByteBuf bf)
      • writeString

        public static void writeString​(String msg,
                                       io.netty.buffer.ByteBuf bf)
      • writeString

        public static void writeString​(Optional<String> msg,
                                       io.netty.buffer.ByteBuf bf)
      • writeXid

        public static void writeXid​(XidImpl xid,
                                    io.netty.buffer.ByteBuf buffer)