Package-level declarations

Types

Link copied to clipboard
open class ArrayReadBuffer(buffer: ByteArray, offset: Int = 0, val limit: Int = buffer.size - offset) : ReadBuffer
Link copied to clipboard
class ArrayReadWriteBuffer(buffer: ByteArray, offset: Int = 0, val writeLimit: Int = -1, var writePosition: Int = offset) : ArrayReadBuffer, ReadWriteBuffer

Implements [ReadWriteBuffer] using ByteArray as backing buffer. Using array of bytes are usually faster than ByteBuffer.

Link copied to clipboard
value class BitWidth(val value: Int)
Link copied to clipboard
open class Blob : Sized

Represent an array of bytes in the buffer.

Link copied to clipboard

This implementation uses Little Endian order.

Link copied to clipboard
value class ByteWidth(val value: Int)
Link copied to clipboard
class FlatBufferBuilder @JvmOverloads constructor(initialSize: Int = 1024, buffer: ReadWriteBuffer = ArrayReadWriteBuffer(initialSize))

Class that helps you build a FlatBuffer. See the section "Use in Kotlin" in the main FlatBuffers documentation.

Link copied to clipboard
class FlexBuffersBuilder(val buffer: ReadWriteBuffer, shareFlag: Int = SHARE_KEYS)
Link copied to clipboard
value class FlexBufferType(val value: Int)
Link copied to clipboard
class JSONParser(var output: FlexBuffersBuilder = FlexBuffersBuilder(1024, SHARE_KEYS_AND_STRINGS))

JSONParser class is used to parse a JSON as FlexBuffers. Calling JSONParser.parse fiils output and returns a Reference ready to be used.

Link copied to clipboard
data class Key(val buffer: ReadBuffer, val start: Int, val end: Int = buffer.findFirst(ZeroByte, start))

Represents a key element in the buffer. Keys are used to reference objects in a Map

Link copied to clipboard
class Map : Sized, Map<Key, Reference>

A Map class that provide support to access Key-Value data from Flexbuffers.

Link copied to clipboard
value class Offset<T>(val value: Int)

Represents a "pointer" to a pointer types (table, string, struct) within the buffer

Link copied to clipboard
value class OffsetArray<T>(val value: IntArray)

Represents an array of offsets. Used to avoid boxing offset types.

Link copied to clipboard
interface ReadBuffer

Represent a chunk of data, where FlexBuffers will be read from.

Link copied to clipboard

Interface to represent a read-write buffers. This interface will be used to access and write FlexBuffer messages.

Link copied to clipboard
class Reference

Represents an generic element in the buffer. It can be specialized into scalar types, using for example, Reference.toInt, or casted into Flexbuffer object types, like Reference.toMap or Reference.toBlob.

Link copied to clipboard
open class Sized

Represents any element that has a size property to it, like: Map, Vector and TypedVector.

Link copied to clipboard
Link copied to clipboard
open class Struct

All structs in the generated code derive from this class, and add their own accessors.

Link copied to clipboard
open class Table

All tables in the generated code derive from this class, and add their own accessors.

Link copied to clipboard
open class TypedVector(elementType: FlexBufferType, val buffer: ReadBuffer, val end: Int, val byteWidth: ByteWidth) : Vector

TypedVector represents an array of scalar elements of the same type in the buffer.

Link copied to clipboard
typealias UnionOffset = Offset<Any>
Link copied to clipboard
Link copied to clipboard
object Utf8
Link copied to clipboard

Vector represents an array of elements in the buffer. The element can be of any type.

Link copied to clipboard
value class VectorOffset<T>(val value: Int)

Represents a "pointer" to a vector type with elements T

Properties

Link copied to clipboard
Link copied to clipboard
val <T> T.value: T
Link copied to clipboard
const val VERSION_2_0_8: Int = 1

Functions

Link copied to clipboard

Reads a FlexBuffer message in ReadBuf and returns Reference to the root element.

Link copied to clipboard
operator fun <T> Offset<T>.minus(other: Int): Offset<T>
operator fun <T> Int.minus(other: Offset<T>): Int
Link copied to clipboard
inline fun <T> OffsetArray(size: Int, crossinline call: (Int) -> Offset<T>): OffsetArray<T>
Link copied to clipboard
expect inline fun ByteArray.setShort(index: Int, value: Short)
actual inline fun ByteArray.setShort(index: Int, value: Short)
actual inline fun ByteArray.setShort(index: Int, value: Short)
actual inline fun ByteArray.setShort(index: Int, value: Short)
Link copied to clipboard
fun Int.sign(): Int
Link copied to clipboard
inline fun StringOffsetArray(size: Int, crossinline call: (Int) -> Offset<String>): StringOffsetArray
Link copied to clipboard

Returns a minified version of this FlexBuffer as a JSON.

Link copied to clipboard
fun <T> Int.toOffset(): Offset<T>
Link copied to clipboard
inline fun UnionOffsetArray(size: Int, crossinline call: (Int) -> Offset<Any>): UnionOffsetArray