ChainedByteBuffer

class ChainedByteBuffer(chunkSize: Int, direct: Boolean, limit: Long) : Iterable<ByteBuffer>

Linked List of ByteBuffers, able to be written to as if it was a single one. Automatically expands if needed.

Constructors

Link copied to clipboard
fun ChainedByteBuffer(chunkSize: Int = 1024, direct: Boolean = false, limit: Long = 0)

Functions

Link copied to clipboard
fun clear()

Empty the buffer

Link copied to clipboard
open fun forEach(p0: Consumer<in ByteBuffer>)
Link copied to clipboard
open operator override fun iterator(): Iterator<ByteBuffer>
Link copied to clipboard
fun put(value: ByteBuffer)

Write the full remaining content of a bytebuffer to the buffer and increment its position

fun put(value: Byte)

Write an 8-bit signed byte to the buffer and increment its position.

fun put(value: ByteArray)

Write the full remaining content of a bytearray to the buffer and increment its position

fun put(value: UByte)

Write an 8-bit unsigned byte to the buffer and increment its position.

Link copied to clipboard
fun putDouble(value: Double)

Write a 64-bit double to the buffer and increment its position.

Link copied to clipboard
fun putFloat(value: Float)

Write a 32-bit float to the buffer and increment its position.

Link copied to clipboard
fun putInt(value: Int)

Write a 32-bit signed int to the buffer and increment its position.

fun putInt(value: UInt)

Write a 32-bit unsigned int to the buffer and increment its position.

Link copied to clipboard
fun putLong(value: Long)

Write a 64-bit signed long to the buffer and increment its position.

fun putLong(value: ULong)

Write a 64-bit unsigned long to the buffer and increment its position.

Link copied to clipboard
fun putShort(value: Short)

Write a 16-bit signed short to the buffer and increment its position.

fun putShort(value: UShort)

Write a 16-bit unsigned short to the buffer and increment its position.

Link copied to clipboard
open fun spliterator(): Spliterator<ByteBuffer>
Link copied to clipboard
fun toBuffer(): ByteBuffer

Convert this buffer into a bytebuffer of the same capacity and content.

Properties

Link copied to clipboard
var size: Int = 0

Number of bytes in the buffer