Modifier and Type | Method and Description |
---|---|
static int |
compare(ByteBuf bufferA,
ByteBuf bufferB)
Compares the two specified buffers as described in
ByteBuf.compareTo(ByteBuf) . |
static ByteBuf |
encodeString(ByteBufAllocator alloc,
CharBuffer src,
Charset charset)
Encode the given
CharBuffer using the given Charset into a new ByteBuf which
is allocated via the ByteBufAllocator . |
static boolean |
equals(ByteBuf bufferA,
ByteBuf bufferB)
Returns
true if and only if the two specified buffers are
identical to each other as described in ChannelBuffer#equals(Object) . |
static int |
hashCode(ByteBuf buffer)
Calculates the hash code of the specified buffer.
|
static String |
hexDump(byte[] array)
Returns a hex dump
of the specified byte array.
|
static String |
hexDump(byte[] array,
int fromIndex,
int length)
Returns a hex dump
of the specified byte array's sub-region.
|
static String |
hexDump(ByteBuf buffer)
Returns a hex dump
of the specified buffer's readable bytes.
|
static String |
hexDump(ByteBuf buffer,
int fromIndex,
int length)
Returns a hex dump
of the specified buffer's sub-region.
|
static int |
indexOf(ByteBuf buffer,
int fromIndex,
int toIndex,
byte value)
The default implementation of
ByteBuf.indexOf(int, int, byte) . |
static ByteBuf |
readBytes(ByteBufAllocator alloc,
ByteBuf buffer,
int length)
Read the given amount of bytes into a new
ByteBuf that is allocated from the ByteBufAllocator . |
static int |
swapInt(int value)
Toggles the endianness of the specified 32-bit integer.
|
static long |
swapLong(long value)
Toggles the endianness of the specified 64-bit long integer.
|
static int |
swapMedium(int value)
Toggles the endianness of the specified 24-bit medium integer.
|
static short |
swapShort(short value)
Toggles the endianness of the specified 16-bit short integer.
|
static ByteBuf |
threadLocalDirectBuffer()
Returns a cached thread-local direct buffer, if available.
|
public static String hexDump(ByteBuf buffer)
public static String hexDump(ByteBuf buffer, int fromIndex, int length)
public static String hexDump(byte[] array, int fromIndex, int length)
public static int hashCode(ByteBuf buffer)
public static boolean equals(ByteBuf bufferA, ByteBuf bufferB)
true
if and only if the two specified buffers are
identical to each other as described in ChannelBuffer#equals(Object)
.
This method is useful when implementing a new buffer type.public static int compare(ByteBuf bufferA, ByteBuf bufferB)
ByteBuf.compareTo(ByteBuf)
.
This method is useful when implementing a new buffer type.public static int indexOf(ByteBuf buffer, int fromIndex, int toIndex, byte value)
ByteBuf.indexOf(int, int, byte)
.
This method is useful when implementing a new buffer type.public static short swapShort(short value)
public static int swapMedium(int value)
public static int swapInt(int value)
public static long swapLong(long value)
public static ByteBuf readBytes(ByteBufAllocator alloc, ByteBuf buffer, int length)
ByteBuf
that is allocated from the ByteBufAllocator
.public static ByteBuf encodeString(ByteBufAllocator alloc, CharBuffer src, Charset charset)
CharBuffer
using the given Charset
into a new ByteBuf
which
is allocated via the ByteBufAllocator
.public static ByteBuf threadLocalDirectBuffer()
null
otherwise.Copyright © 2008–2014 The Netty Project. All rights reserved.