public class CharByteBufUtil extends Object
Modifier and Type | Method and Description |
---|---|
static char[] |
readUtf8(ByteBuf byteBuf,
int length) |
static int |
utf8Bytes(char[] seq)
Returns the exact bytes length of UTF8 character sequence.
|
static int |
utf8Bytes(char[] seq,
int start,
int end)
This method is producing the exact length according to
writeUtf8(ByteBuf, char[], int,
int) . |
static int |
writeUtf8(ByteBuf buf,
char[] seq)
|
static int |
writeUtf8(ByteBuf buf,
char[] seq,
int start,
int end)
Equivalent to
writeUtf8(buf, seq.subSequence(start, end),
reserveBytes) but avoids subsequence object allocation if possible. |
public static int utf8Bytes(char[] seq)
This method is producing the exact length according to writeUtf8(ByteBuf, char[])
.
public static int utf8Bytes(char[] seq, int start, int end)
writeUtf8(ByteBuf, char[], int,
int)
.public static int writeUtf8(ByteBuf buf, char[] seq)
public static int writeUtf8(ByteBuf buf, char[] seq, int start, int end)
writeUtf8(buf, seq.subSequence(start, end),
reserveBytes)
but avoids subsequence object allocation if possible.public static char[] readUtf8(ByteBuf byteBuf, int length)