FlatBuffers
An open source project by FPL.
com.google.flatbuffers.Utf8Old Class Reference

This class implements the Utf8 API using the Java Utf8 encoder. More...

Inheritance diagram for com.google.flatbuffers.Utf8Old:
com.google.flatbuffers.Utf8

Detailed Description

This class implements the Utf8 API using the Java Utf8 encoder.

Use Utf8.setDefault(new Utf8Old()); to use it.

Public Member Functions

String decodeUtf8 (ByteBuffer buffer, int offset, int length)
 Decodes the given UTF-8 portion of the ByteBuffer into a String. More...
 
int encodedLength (CharSequence in)
 Returns the number of bytes in the UTF-8-encoded form of. More...
 
void encodeUtf8 (CharSequence in, ByteBuffer out)
 Encodes the given characters to the target ByteBuffer using UTF-8 encoding. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from com.google.flatbuffers.Utf8
static int encodeUtf8CodePoint (CharSequence in, int start, byte[] out)
 Encode a Java's CharSequence UTF8 codepoint into a byte array. More...
 
static Utf8 getDefault ()
 Get the default UTF-8 processor. More...
 
static void setDefault (Utf8 instance)
 Set the default instance of the UTF-8 processor. More...
 

Member Function Documentation

◆ decodeUtf8()

String com.google.flatbuffers.Utf8Old.decodeUtf8 ( ByteBuffer  buffer,
int  offset,
int  length 
)
inline

Decodes the given UTF-8 portion of the ByteBuffer into a String.

Exceptions
IllegalArgumentExceptionif the input is not valid UTF-8.

Reimplemented from com.google.flatbuffers.Utf8.

◆ encodedLength()

int com.google.flatbuffers.Utf8Old.encodedLength ( CharSequence  sequence)
inline

Returns the number of bytes in the UTF-8-encoded form of.

sequence

. For a string, this method is equivalent to

string.getBytes(UTF_8).length

, but is more efficient in both time and space.

Exceptions
IllegalArgumentExceptionif
sequence
contains ill-formed UTF-16 (unpaired surrogates)

Reimplemented from com.google.flatbuffers.Utf8.

◆ encodeUtf8()

void com.google.flatbuffers.Utf8Old.encodeUtf8 ( CharSequence  in,
ByteBuffer  out 
)
inline

Encodes the given characters to the target ByteBuffer 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.

Parameters
inthe source string to be encoded
outthe target buffer to receive the encoded string.

Reimplemented from com.google.flatbuffers.Utf8.


The documentation for this class was generated from the following file: