Class ExtendedByteBuf
java.lang.Object
org.infinispan.server.hotrod.transport.ExtendedByteBuf
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.buffer.ByteBuf
buffer
(int capacity) static io.netty.buffer.ByteBuf
readMaybeByte
(io.netty.buffer.ByteBuf bf) Reads a byte if possible.readMaybeLong
(io.netty.buffer.ByteBuf bf) readMaybeOptRangedBytes
(io.netty.buffer.ByteBuf bf) Read a range of bytes prefixed by its length (encoded as a signed VInt).readMaybeOptString
(io.netty.buffer.ByteBuf bf) static Optional<byte[]>
readMaybeRangedBytes
(io.netty.buffer.ByteBuf bf) Reads a range of bytes if possible.static Optional<byte[]>
readMaybeRangedBytes
(io.netty.buffer.ByteBuf bf, int length) readMaybeSignedInt
(io.netty.buffer.ByteBuf bf) readMaybeString
(io.netty.buffer.ByteBuf bf) Reads a string if possible.readMaybeVInt
(io.netty.buffer.ByteBuf bf) Reads a variable size int if possible.readMaybeVLong
(io.netty.buffer.ByteBuf bf) Reads a variable long if possible.static Optional<byte[]>
readOptRangedBytes
(io.netty.buffer.ByteBuf bf) Reads optional range of bytes.readOptString
(io.netty.buffer.ByteBuf bf) Reads an optional String.static byte[]
readRangedBytes
(io.netty.buffer.ByteBuf bf) static byte[]
readRangedBytes
(io.netty.buffer.ByteBuf bf, int length) static String
readString
(io.netty.buffer.ByteBuf bf) Reads length of String and then returns an UTF-8 formatted String of such length.static int
readUnsignedInt
(io.netty.buffer.ByteBuf bf) static long
readUnsignedLong
(io.netty.buffer.ByteBuf bf) static int
readUnsignedShort
(io.netty.buffer.ByteBuf bf) static io.netty.buffer.ByteBuf
wrappedBuffer
(byte[]... arrays) static void
writeRangedBytes
(byte[] src, int offset, io.netty.buffer.ByteBuf bf) static void
writeRangedBytes
(byte[] src, io.netty.buffer.ByteBuf bf) static void
writeRangedBytes
(ByteBuffer src, io.netty.buffer.ByteBuf bf) static void
writeString
(String msg, io.netty.buffer.ByteBuf bf) static void
writeString
(Optional<String> msg, io.netty.buffer.ByteBuf bf) static void
writeUnsignedInt
(int i, io.netty.buffer.ByteBuf bf) static void
writeUnsignedLong
(long l, io.netty.buffer.ByteBuf bf) static void
writeUnsignedShort
(int i, io.netty.buffer.ByteBuf bf) static void
-
Constructor Details
-
ExtendedByteBuf
public ExtendedByteBuf()
-
-
Method Details
-
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
Reads optional range of bytes. Negative lengths are translated to None, 0 length represents empty Array -
readOptString
Reads an optional String. 0 length is an empty string, negative length is translated to None. -
readString
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
Reads a byte if possible. If not present the reader index is reset to the last mark.- Parameters:
bf
-- Returns:
-
readMaybeLong
-
readMaybeVLong
Reads a variable long if possible. If not present the reader index is reset to the last mark.- Parameters:
bf
-- Returns:
-
readMaybeVInt
Reads a variable size int if possible. If not present the reader index is reset to the last mark.- Parameters:
bf
-- Returns:
-
readMaybeRangedBytes
Reads a range of bytes if possible. If not present the reader index is reset to the last mark.- Parameters:
bf
-- Returns:
-
readMaybeRangedBytes
-
readMaybeSignedInt
-
readMaybeOptRangedBytes
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, orOptional.empty()
if the input buffer didn't contain the entire range.
-
readMaybeString
Reads a string if possible. If not present the reader index is reset to the last mark.- Parameters:
bf
-- Returns:
-
readMaybeOptString
-
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
-
writeString
-
writeString
-
writeXid
-