Class Utf8Old

java.lang.Object
io.objectbox.flatbuffers.Utf8
io.objectbox.flatbuffers.Utf8Old

public class Utf8Old extends Utf8
This class implements the Utf8 API using the Java Utf8 encoder. Use Utf8.setDefault(new Utf8Old()); to use it.
  • Constructor Details

    • Utf8Old

      public Utf8Old()
  • Method Details

    • encodedLength

      public int encodedLength(CharSequence in)
      Description copied from class: Utf8
      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.
      Specified by:
      encodedLength in class Utf8
    • encodeUtf8

      public void encodeUtf8(CharSequence in, ByteBuffer out)
      Description copied from class: Utf8
      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.

      Specified by:
      encodeUtf8 in class Utf8
      Parameters:
      in - the source string to be encoded
      out - the target buffer to receive the encoded string.
    • decodeUtf8

      public String decodeUtf8(ByteBuffer buffer, int offset, int length)
      Description copied from class: Utf8
      Decodes the given UTF-8 portion of the ByteBuffer into a String.
      Specified by:
      decodeUtf8 in class Utf8