|
class | DecodeUtil |
| Utility methods for decoding bytes into String.
|
|
class | UnpairedSurrogateException |
|
|
abstract String | decodeUtf8 (ByteBuffer buffer, int offset, int length) |
| Decodes the given UTF-8 portion of the ByteBuffer into a String. More...
|
|
abstract int | encodedLength (CharSequence sequence) |
| Returns the number of bytes in the UTF-8-encoded form of. More...
|
|
abstract void | encodeUtf8 (CharSequence in, ByteBuffer out) |
| Encodes the given characters to the target ByteBuffer using UTF-8 encoding. More...
|
|
◆ decodeUtf8()
abstract String com.google.flatbuffers.Utf8.decodeUtf8 |
( |
ByteBuffer |
buffer, |
|
|
int |
offset, |
|
|
int |
length |
|
) |
| |
|
abstract |
◆ encodedLength()
abstract int com.google.flatbuffers.Utf8.encodedLength |
( |
CharSequence |
sequence | ) |
|
|
abstract |
Returns the number of bytes in the UTF-8-encoded form of.
. For a string, this method is equivalent to
string.getBytes(UTF_8).length
, but is more efficient in both time and space.
- Exceptions
-
IllegalArgumentException | if contains ill-formed UTF-16 (unpaired surrogates) |
Reimplemented in com.google.flatbuffers.Utf8Safe, and com.google.flatbuffers.Utf8Old.
◆ encodeUtf8()
abstract void com.google.flatbuffers.Utf8.encodeUtf8 |
( |
CharSequence |
in, |
|
|
ByteBuffer |
out |
|
) |
| |
|
abstract |
◆ encodeUtf8CodePoint()
static int com.google.flatbuffers.Utf8.encodeUtf8CodePoint |
( |
CharSequence |
in, |
|
|
int |
start, |
|
|
byte[] |
out |
|
) |
| |
|
inlinestatic |
Encode a Java's CharSequence UTF8 codepoint into a byte array.
- Parameters
-
in | CharSequence to be encoded |
start | start position of the first char in the codepoint |
out | byte array of 4 bytes to be filled |
- Returns
- return the amount of bytes occupied by the codepoint
◆ getDefault()
static Utf8 com.google.flatbuffers.Utf8.getDefault |
( |
| ) |
|
|
inlinestatic |
Get the default UTF-8 processor.
- Returns
- the default processor
◆ setDefault()
static void com.google.flatbuffers.Utf8.setDefault |
( |
Utf8 |
instance | ) |
|
|
inlinestatic |
Set the default instance of the UTF-8 processor.
- Parameters
-
instance | the new instance to use |
The documentation for this class was generated from the following file: