Package de.justjanne.libquassel.protocol.io

Types

Link copied to clipboard
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.

Link copied to clipboard
class CoroutineChannel : StateHolder<CoroutineChannelState> , Closeable
Link copied to clipboard
data class CoroutineChannelState(tlsInfo: TlsInfo?, compression: Boolean, connected: Boolean)
Link copied to clipboard
class FixedDeflaterOutputStream(stream: OutputStream) : DeflaterOutputStream

Wrapper class around a DeflaterOutputStream correctly handling closing of the current stream

Link copied to clipboard
class ReadableWrappedChannel(backingStream: InputStream) : AbstractInterruptibleChannel, ReadableByteChannel

Utility function to wrap an input stream into a readable channel

Link copied to clipboard
class StreamChannel(socket: Socket, inputStream: InputStream, outputStream: OutputStream) : Flushable, ByteChannel, InterruptibleChannel

Channel wrapping a Socket with support for TLS and compression layers

Link copied to clipboard
class StringEncoder(charset: Charset)

Class encapsulating encoding/decoding for a certain charset

Link copied to clipboard
class WritableWrappedChannel(backingStream: OutputStream) : AbstractInterruptibleChannel, WritableByteChannel

Utility function to wrap an output stream into a writable channel

Functions

Link copied to clipboard
fun ByteBuffer.contentToString(): String

Utility function to generate a hexdump of a buffer

Link copied to clipboard
fun copyData(from: ByteBuffer, desiredAmount: Int): ByteBuffer

Copy data from a buffer

fun copyData(from: ByteBuffer, to: ByteBuffer, desiredAmount: Int)

Copy data from one buffer to another

Link copied to clipboard
fun ByteBuffer?.isEmpty(): Boolean

Utility function to determine whether a buffer can be read from/written to.

Link copied to clipboard
inline fun useChainedByteBuffer(function: (ChainedByteBuffer) -> Unit): ByteBuffer

Utility function to apply a closure to a chained byte buffer and return its data