Output

Deprecated

We're migrating to the new kotlinx-io library. This declaration is deprecated and will be removed in Ktor 4.0.0 If you have any problems with migration, please contact us in https://youtrack.jetbrains.com/issue/KTOR-6030/Migrate-to-new-kotlinx.io-library

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

Inheritors

Constructors

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

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
fun Output.append(csq: CharArray, start: Int = 0, end: Int = csq.size): Appendable
fun Output.append(csq: CharSequence, start: Int = 0, end: Int = csq.length): Appendable
Link copied to clipboard
override fun close()

Should flush and close the destination

Link copied to clipboard
fun Output.fill(times: Long, value: Byte = 0)
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 Output.writeDouble(value: Double, byteOrder: ByteOrder)
Link copied to clipboard
Link copied to clipboard
fun Output.writeFloat(value: Float)
fun Output.writeFloat(value: Float, byteOrder: ByteOrder)
Link copied to clipboard
Link copied to clipboard
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)
fun Output.writeFully(src: ByteArray, 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: FloatArray, 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: ShortArray, offset: Int = 0, length: Int = src.size - offset)
inline fun Output.writeFully(array: UByteArray, 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)
inline fun Output.writeFully(array: UShortArray, offset: Int = 0, length: Int = array.size - offset)
fun Output.writeFully(src: CPointer<ByteVar>, offset: Int, length: Int)
fun Output.writeFully(src: CPointer<ByteVar>, offset: Long, length: Long)
Link copied to clipboard
fun Output.writeFullyLittleEndian(source: DoubleArray, 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: IntArray, 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: 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: ULongArray, offset: Int = 0, length: Int = source.size - offset)
fun Output.writeFullyLittleEndian(source: UShortArray, offset: Int = 0, length: Int = source.size - offset)
Link copied to clipboard
fun Output.writeInt(value: Int)
fun Output.writeInt(value: Int, byteOrder: ByteOrder)
Link copied to clipboard
Link copied to clipboard
fun Output.writeLong(value: Long)
fun Output.writeLong(value: Long, byteOrder: ByteOrder)
Link copied to clipboard
Link copied to clipboard

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

Write exact n bytes from packet to the builder

Link copied to clipboard
fun Output.writeShort(value: Short)
fun Output.writeShort(value: Short, byteOrder: ByteOrder)
Link copied to clipboard
Link copied to clipboard
fun Output.writeText(text: CharArray, fromIndex: Int = 0, toIndex: Int = text.size, charset: Charset = Charsets.UTF_8)
fun Output.writeText(text: CharSequence, fromIndex: Int = 0, toIndex: Int = text.length, charset: Charset = Charsets.UTF_8)

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard