expect interface Output : Appendable, Closeable
This shouldn't be implemented directly. Inherit AbstractOutput instead.
abstract var |
abstract fun append(csq: CharArray, start: Int, end: Int): Appendable |
|
abstract fun close(): Unit |
|
open fun |
|
abstract fun flush(): Unit |
|
abstract fun writeByte(v: Byte): Unit |
|
open fun |
|
open fun |
|
open fun open fun open fun open fun open fun open fun open fun open fun |
|
open fun |
|
open fun |
|
open fun |
fun Output. fun Output.afterHeadWrite(current: ChunkBuffer): Unit |
|
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 |
|
fun Output.fill(times: Long, value: Byte = 0): Unit |
|
fun Output. fun Output.prepareWriteHead(capacity: Int, current: ChunkBuffer?): ChunkBuffer |
|
fun <O : Output, R> O.use(block: (O) -> R): R |
|
fun Output.writeDouble(value: Double, byteOrder: ByteOrder): Unit fun Output.writeDouble(value: Double): Unit |
|
fun Output.writeDoubleLittleEndian(value: Double): Unit |
|
fun Output.writeFloat(value: Float, byteOrder: ByteOrder): Unit fun Output.writeFloat(value: Float): Unit |
|
fun Output.writeFloatLittleEndian(value: Float): Unit |
|
fun Output.writeFully(src: ByteArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output.writeFully(src: ShortArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output.writeFully(src: IntArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output.writeFully(src: LongArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output.writeFully(src: FloatArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output.writeFully(src: DoubleArray, offset: Int = 0, length: Int = src.size - offset): Unit fun Output. fun Output.writeFully(src: Buffer, length: Int = src.readRemaining): Unit fun Output.writeFully(src: Memory, offset: Int, length: Int): Unit fun Output.writeFully(src: Memory, offset: Long, length: Long): Unit fun Output.writeFully(array: <ERROR CLASS>, offset: Int = 0, length: Int = array.size - offset): Unit fun Output.writeFully(bb: ByteBuffer): Unit |
|
fun Output.writeFullyLittleEndian(source: <ERROR CLASS>, offset: Int = 0, length: Int = source.size - offset): Unit fun Output.writeFullyLittleEndian(source: ShortArray, offset: Int = 0, length: Int = source.size - offset): Unit fun Output.writeFullyLittleEndian(source: IntArray, offset: Int = 0, length: Int = source.size - offset): Unit fun Output.writeFullyLittleEndian(source: LongArray, offset: Int = 0, length: Int = source.size - offset): Unit fun Output.writeFullyLittleEndian(source: FloatArray, offset: Int = 0, length: Int = source.size - offset): Unit fun Output.writeFullyLittleEndian(source: DoubleArray, offset: Int = 0, length: Int = source.size - offset): Unit |
|
fun Output.writeInt(value: Int, byteOrder: ByteOrder): Unit fun Output.writeInt(value: Int): Unit |
|
fun Output.writeIntLittleEndian(value: Int): Unit |
|
fun Output.writeLong(value: Long, byteOrder: ByteOrder): Unit fun Output.writeLong(value: Long): Unit |
|
fun Output.writeLongLittleEndian(value: Long): Unit |
|
fun Output.writePacket(packet: ByteReadPacket): Unit |
|
fun Output.writeShort(value: Short, byteOrder: ByteOrder): Unit fun Output.writeShort(value: Short): Unit |
|
fun Output.writeShortLittleEndian(value: Short): Unit |
|
fun Output.
Writes text characters in range \[fromIndex .. toIndex) with the specified encoder fun Output.writeText(text: CharSequence, fromIndex: Int = 0, toIndex: Int = text.length, charset: Charset = Charsets.UTF_8): Unit fun Output.writeText(text: CharArray, fromIndex: Int = 0, toIndex: Int = text.size, charset: Charset = Charsets.UTF_8): Unit
Writes text characters in range \[fromIndex .. toIndex) with the specified charset |
|
fun Output.writeUByte(v: <ERROR CLASS>): Unit |
|
fun Output.writeUInt(v: <ERROR CLASS>): Unit |
|
fun Output.writeULong(v: <ERROR CLASS>): Unit |
|
fun Output.writeUShort(v: <ERROR CLASS>): Unit |
|
fun Output.writeWhile(block: (Buffer) -> Boolean): Unit
Append number of chunks invoking block function while the returned value is true. Depending on the output underlying implementation it could invoke block function with the same buffer several times however it is guaranteed that it is always non-empty. |
|
fun Output.writeWhileSize(initialSize: Int = 1, block: (Buffer) -> Int): Unit
Append number of chunks invoking block function while the returned value is positive. If returned value is positive then it will be invoked again with a buffer having at least requested number of bytes space (could be the same buffer as before if it complies to the restriction). |
abstract class AbstractOutput : Appendable, Output
The default Output implementation. |
|
expect class
A read-write facade to actual buffer of fixed size. Multiple views could share the same actual buffer. Concurrent unsafe. The only concurrent-safe operation is release. In most cases ByteReadPacket and BytePacketBuilder should be used instead. |