AbstractOutput
abstract class AbstractOutput : Appendable, Output
The default Output implementation.
See Also
Constructors
AbstractOutput(pool: ObjectPool<ChunkBuffer>) AbstractOutput() |
Properties
var _size: Int Number of bytes currently buffered (pending). |
|
var Byte order (Endianness) to be used by future write functions calls on this builder instance. Doesn’t affect any previously written values. |
|
var |
|
val pool: ObjectPool<ChunkBuffer> |
Functions
fun afterHeadWrite(): Unit |
|
open fun append(c: Char): AbstractOutput Append single UTF-8 character open fun append(csq: CharSequence?): AbstractOutput open fun append( open fun append( |
|
fun |
|
fun close(): Unit Should flush and close the destination |
|
abstract fun closeDestination(): Unit An implementation should only close the destination. |
|
An implementation should write source to the destination exactly length bytes. It should never capture the source instance longer than this method execution since it may be disposed after return. fun flush(): Unit |
|
fun prepareWriteHead(n: Int): ChunkBuffer |
|
fun release(): Unit Release any resources that the builder holds. Builder shouldn’t be used after release |
|
open fun |
|
fun writePacket(p: ByteReadPacket): Unit Writes another packet to the end. Please note that the instance p gets consumed so you don’t need to release it fun writePacket(p: ByteReadPacket, n: Int): Unit fun writePacket(p: ByteReadPacket, n: Long): Unit Write exact n bytes from packet to the builder |
|
fun |
Inherited Functions
open fun open fun open fun open fun |
|
Extension Functions
fun Output.afterHeadWrite(current: ChunkBuffer): Unit |
|
fun Output.append( fun Output.append( |
|
fun Output.prepareWriteHead( |
|
fun Output.writeFully( fun Output.writeFully( fun Output.writeFully( fun Output.writeFully( fun Output.writeFully(bb: ByteBuffer): Unit |
|
fun Output.writeFullyLittleEndian( fun Output.writeFullyLittleEndian( fun Output.writeFullyLittleEndian( fun Output.writeFullyLittleEndian( fun Output.writeFullyLittleEndian( fun Output.writeFullyLittleEndian( |
|
fun Output.writePacket(packet: ByteReadPacket): Unit |
|
fun Output. Writes text characters in range [fromIndex .. toIndex) with the specified encoder fun Output.writeText( fun Output.writeText( Writes text characters in range [fromIndex .. toIndex) with the specified charset |
|
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. |
|
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). |
Inheritors
abstract class |