Buffer

actual class Buffer : BufferBase(source)

SQLite managed memory region that can be read and written.

The memory region can theoretically carry up to Long.MAX_VALUE bytes on JVM (+ Android) and Native, but it can be limited to Int.MAX_VALUE on web targets.

The memory is allocated using ksqlite.capi.sqlite3_malloc, ksqlite.capi.sqlite3_malloc64, ksqlite.capi.sqlite3_realloc or ksqlite.capi.sqlite3_realloc64 and must be freed when no longer required by passing this buffer to ksqlite.capi.sqlite3_free.

Buffer does not provide any kind of thread-safety and external synchronization is required if concurrent access is needed.

expect class Buffer : BufferBase(source)

SQLite managed memory region that can be read and written.

The memory region can theoretically carry up to Long.MAX_VALUE bytes on JVM (+ Android) and Native, but it can be limited to Int.MAX_VALUE on web targets.

The memory is allocated using ksqlite.capi.sqlite3_malloc, ksqlite.capi.sqlite3_malloc64, ksqlite.capi.sqlite3_realloc or ksqlite.capi.sqlite3_realloc64 and must be freed when no longer required by passing this buffer to ksqlite.capi.sqlite3_free.

Buffer does not provide any kind of thread-safety and external synchronization is required if concurrent access is needed.

actual class Buffer : BufferBase(source)

SQLite managed memory region that can be read and written.

The memory region can theoretically carry up to Long.MAX_VALUE bytes on JVM (+ Android) and Native, but it can be limited to Int.MAX_VALUE on web targets.

The memory is allocated using ksqlite.capi.sqlite3_malloc, ksqlite.capi.sqlite3_malloc64, ksqlite.capi.sqlite3_realloc or ksqlite.capi.sqlite3_realloc64 and must be freed when no longer required by passing this buffer to ksqlite.capi.sqlite3_free.

Buffer does not provide any kind of thread-safety and external synchronization is required if concurrent access is needed.

actual class Buffer : BufferBase(source)

SQLite managed memory region that can be read and written.

The memory region can theoretically carry up to Long.MAX_VALUE bytes on JVM (+ Android) and Native, but it can be limited to Int.MAX_VALUE on web targets.

The memory is allocated using ksqlite.capi.sqlite3_malloc, ksqlite.capi.sqlite3_malloc64, ksqlite.capi.sqlite3_realloc or ksqlite.capi.sqlite3_realloc64 and must be freed when no longer required by passing this buffer to ksqlite.capi.sqlite3_free.

Buffer does not provide any kind of thread-safety and external synchronization is required if concurrent access is needed.

actual open class Buffer : BufferBase(source)

SQLite managed memory region that can be read and written.

The memory region can theoretically carry up to Long.MAX_VALUE bytes on JVM (+ Android) and Native, but it can be limited to Int.MAX_VALUE on web targets.

The memory is allocated using ksqlite.capi.sqlite3_malloc, ksqlite.capi.sqlite3_malloc64, ksqlite.capi.sqlite3_realloc or ksqlite.capi.sqlite3_realloc64 and must be freed when no longer required by passing this buffer to ksqlite.capi.sqlite3_free.

Buffer does not provide any kind of thread-safety and external synchronization is required if concurrent access is needed.

Properties

Link copied to clipboard

Size of the memory region in bytes.

Size of the memory region in bytes.

Size of the memory region in bytes.

Size of the memory region in bytes.

Size of the memory region in bytes.

Functions

Link copied to clipboard
fun read(destination: ByteArray, size: Int = destination.size, sourceOffset: Long = 0, destinationOffset: Int = 0)

Reads size bytes from the native memory block into destination.

fun read(destination: ByteArray, size: Int = destination.size, sourceOffset: Long = 0, destinationOffset: Int = 0)

Reads size bytes from the native memory block into destination.

fun read(destination: ByteArray, size: Int = destination.size, sourceOffset: Long = 0, destinationOffset: Int = 0)

Reads size bytes from the native memory block into destination.

fun read(destination: ByteArray, size: Int = destination.size, sourceOffset: Long = 0, destinationOffset: Int = 0)

Reads size bytes from the native memory block into destination.

fun read(destination: ByteArray, size: Int = destination.size, sourceOffset: Long = 0, destinationOffset: Int = 0)

Reads size bytes from the native memory block into destination.

Link copied to clipboard
fun ReadableBuffer.read(size: Int, offset: Long = 0): ByteArray

Reads size bytes from the native memory block and returns a ByteArray holding them.

Link copied to clipboard

Reads at most Int.MAX_VALUE bytes from this buffer.

Link copied to clipboard

Reads all bytes from this buffer.

Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
Link copied to clipboard
fun write(source: ByteArray, size: Int = source.size, sourceOffset: Int = 0, destinationOffset: Long = 0)

Writes size bytes from source into the native memory block.

fun write(source: ByteArray, size: Int = source.size, sourceOffset: Int = 0, destinationOffset: Long = 0)

Writes size bytes from source into the native memory block.

fun write(source: ByteArray, size: Int = source.size, sourceOffset: Int = 0, destinationOffset: Long = 0)

Writes size bytes from source into the native memory block.

fun write(source: ByteArray, size: Int = source.size, sourceOffset: Int = 0, destinationOffset: Long = 0)

Writes size bytes from source into the native memory block.

fun write(source: ByteArray, size: Int = source.size, sourceOffset: Int = 0, destinationOffset: Long = 0)

Writes size bytes from source into the native memory block.