public class Utf8Old extends Utf8
| Constructor and Description |
|---|
Utf8Old() |
| Modifier and Type | Method and Description |
|---|---|
String |
decodeUtf8(ByteBuffer buffer,
int offset,
int length)
Decodes the given UTF-8 portion of the
ByteBuffer into a String. |
int |
encodedLength(CharSequence in)
Returns the number of bytes in the UTF-8-encoded form of
sequence. |
void |
encodeUtf8(CharSequence in,
ByteBuffer out)
Encodes the given characters to the target
ByteBuffer using UTF-8 encoding. |
getDefault, setDefaultpublic int encodedLength(CharSequence in)
Utf8sequence. For a string,
this method is equivalent to string.getBytes(UTF_8).length, but is more efficient in
both time and space.encodedLength in class Utf8public void encodeUtf8(CharSequence in, ByteBuffer out)
Utf8ByteBuffer using UTF-8 encoding.
Selects an optimal algorithm based on the type of ByteBuffer (i.e. heap or direct)
and the capabilities of the platform.
encodeUtf8 in class Utf8in - the source string to be encodedout - the target buffer to receive the encoded string.public String decodeUtf8(ByteBuffer buffer, int offset, int length)
Utf8ByteBuffer into a String.decodeUtf8 in class Utf8Copyright © 2020. All rights reserved.