Output

abstract class Output : Appendable, Closeable

This shouldn't be implemented directly. Inherit Output instead.

Constructors

Link copied to clipboard
fun Output(pool: ObjectPool<ChunkBuffer>)
Link copied to clipboard
fun Output()

Functions

Link copied to clipboard
open override fun append(value: Char): Output

Append single UTF-8 character

open override fun append(value: CharSequence?): Output
fun append(csq: CharArray, start: Int, end: Int): Appendable
open override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): Output
Link copied to clipboard
override fun close()

Should flush and close the destination

Link copied to clipboard
fun flush()
Link copied to clipboard
fun release()

Release any resources that the builder holds. Builder shouldn't be used after release

Link copied to clipboard
fun writeByte(v: Byte)
Link copied to clipboard
fun writePacket(packet: ByteReadPacket)

Writes another packet to the end. Please note that the instance packet gets consumed so you don't need to release it

fun writePacket(p: ByteReadPacket, n: Int)
fun writePacket(p: ByteReadPacket, n: Long)

Write exact n bytes from packet to the builder

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun Output.append(csq: CharSequence, start: Int = 0, end: Int = csq.length): Appendable
fun Output.append(csq: CharArray, start: Int = 0, end: Int = csq.size): Appendable
Link copied to clipboard
fun Output.fill(times: Long, value: Byte = 0)
Link copied to clipboard
fun Output.writeDouble(value: Double, byteOrder: ByteOrder)
fun Output.writeDouble(value: Double)
Link copied to clipboard
fun Output.writeDoubleLittleEndian(value: Double)
Link copied to clipboard
fun Output.writeFloat(value: Float, byteOrder: ByteOrder)
fun Output.writeFloat(value: Float)
Link copied to clipboard
fun Output.writeFloatLittleEndian(value: Float)
Link copied to clipboard
fun Output.writeFully(src: ByteArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: ShortArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: IntArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: LongArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: FloatArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: DoubleArray, offset: Int = 0, length: Int = src.size - offset)
fun Output.writeFully(src: Buffer, length: Int = src.readRemaining)
fun Output.writeFully(src: Memory, offset: Int, length: Int)
fun Output.writeFully(src: Memory, offset: Long, length: Long)
inline fun Output.writeFully(array: UByteArray, offset: Int = 0, length: Int = array.size - offset)
inline fun Output.writeFully(array: UShortArray, offset: Int = 0, length: Int = array.size - offset)
inline fun Output.writeFully(array: UIntArray, offset: Int = 0, length: Int = array.size - offset)
inline fun Output.writeFully(array: ULongArray, offset: Int = 0, length: Int = array.size - offset)
fun Output.writeFully(bb: ByteBuffer)
fun Output.writeFully(src: <ERROR CLASS><<ERROR CLASS>>, offset: Int, length: Int)
fun Output.writeFully(src: <ERROR CLASS><<ERROR CLASS>>, offset: Long, length: Long)
Link copied to clipboard
fun Output.writeFullyLittleEndian(source: UShortArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: ShortArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: UIntArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: IntArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: ULongArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: LongArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: FloatArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: DoubleArray, offset: Int = 0, length: Int = source.size - offset)
Link copied to clipboard
fun Output.writeInt(value: Int, byteOrder: ByteOrder)
fun Output.writeInt(value: Int)
Link copied to clipboard
fun Output.writeIntLittleEndian(value: Int)
Link copied to clipboard
fun Output.writeLong(value: Long, byteOrder: ByteOrder)
fun Output.writeLong(value: Long)
Link copied to clipboard
fun Output.writeLongLittleEndian(value: Long)
Link copied to clipboard
fun Output.writeShort(value: Short, byteOrder: ByteOrder)
fun Output.writeShort(value: Short)
Link copied to clipboard
fun Output.writeShortLittleEndian(value: Short)
Link copied to clipboard
fun Output.writeText(text: CharSequence, fromIndex: Int = 0, toIndex: Int = text.length, charset: Charset = Charsets.UTF_8)
fun Output.writeText(text: CharArray, fromIndex: Int = 0, toIndex: Int = text.size, charset: Charset = Charsets.UTF_8)

Writes text characters in range \[fromIndex .. toIndex) with the specified charset

Link copied to clipboard
inline fun Output.writeUByte(v: UByte)
Link copied to clipboard
inline fun Output.writeUInt(v: UInt)
Link copied to clipboard
inline fun Output.writeULong(v: ULong)
Link copied to clipboard
inline fun Output.writeUShort(v: UShort)