Package io.ktor.utils.io.streams

Functions

asInput
Link copied to clipboard
fun InputStream.asInput(pool: ObjectPool<ChunkBuffer> = ChunkBuffer.Pool): Input
asOutput
Link copied to clipboard
fun OutputStream.asOutput(): Output
fread
Link copied to clipboard
posix
fun fread(buffer: Buffer, stream: <ERROR CLASS><<ERROR CLASS>>): <ERROR CLASS>
fun fread(destination: Memory, offset: Int, length: Int, stream: <ERROR CLASS><<ERROR CLASS>>): Int
fun fread(destination: Memory, offset: Long, length: Long, stream: <ERROR CLASS><<ERROR CLASS>>): Long
fwrite
Link copied to clipboard
posix
fun fwrite(buffer: Buffer, stream: <ERROR CLASS><<ERROR CLASS>>): <ERROR CLASS>
fun fwrite(source: Memory, offset: Int, length: Int, stream: <ERROR CLASS><<ERROR CLASS>>): Int
fun fwrite(source: Memory, offset: Long, length: Long, stream: <ERROR CLASS><<ERROR CLASS>>): Long
Input
Link copied to clipboard
posix
fun Input(file: <ERROR CLASS><<ERROR CLASS>>): Input
Create a blocking Input reading from the specified file instance using fread.
fun Input(fileDescriptor: Int): Input
Create a blocking Input reading from the specified fileDescriptor using read.
inputStream
Link copied to clipboard
fun ByteReadPacket.inputStream(): InputStream
Creates InputStream adapter to the packet
Output
Link copied to clipboard
posix
fun Output(file: <ERROR CLASS><<ERROR CLASS>>): Output
Create a blocking Output writing to the specified file instance using fwrite.
fun Output(fileDescriptor: Int): Output
Create a blocking Output writing to the specified fileDescriptor using write.
outputStream
Link copied to clipboard
fun BytePacketBuilder.outputStream(): OutputStream
Creates OutputStream adapter to the builder
read
Link copied to clipboard
posix
fun read(fildes: Int, buffer: Buffer): <ERROR CLASS>
fun read(fildes: Int, destination: Memory, offset: Int, length: Int): Int
fun read(fildes: Int, destination: Memory, offset: Long, length: Long): Long
readerUTF8
Link copied to clipboard
fun ByteReadPacket.readerUTF8(): Reader
Creates Reader from the byte packet that decodes UTF-8 characters
readPacketAtLeast
Link copied to clipboard
fun InputStream.readPacketAtLeast(n: Long): ByteReadPacket
Read a packet of at least n bytes or all remaining.
readPacketAtMost
Link copied to clipboard
fun InputStream.readPacketAtMost(n: Long): ByteReadPacket
Read a packet of at most n bytes.
readPacketExact
Link copied to clipboard
fun InputStream.readPacketExact(n: Long): ByteReadPacket
Read a packet of exactly n bytes
recv
Link copied to clipboard
posix
fun recv(socket: <ERROR CLASS>, buffer: Buffer, flags: Int): <ERROR CLASS>
recvfrom
Link copied to clipboard
posix
fun recvfrom(socket: <ERROR CLASS>, buffer: Buffer, flags: Int, addr: <ERROR CLASS><<ERROR CLASS>>, addr_len: <ERROR CLASS><<ERROR CLASS>>): <ERROR CLASS>
send
Link copied to clipboard
posix
fun send(socket: <ERROR CLASS>, buffer: Buffer, flags: Int): <ERROR CLASS>
fun send(socket: <ERROR CLASS>, source: Memory, sourceOffset: Int, maxLength: Int, flags: Int): Int
fun send(socket: <ERROR CLASS>, source: Memory, sourceOffset: Long, maxLength: Long, flags: Int): Long
sendto
Link copied to clipboard
posix
fun sendto(socket: <ERROR CLASS>, buffer: Buffer, flags: Int, addr: <ERROR CLASS><<ERROR CLASS>>, addr_len: <ERROR CLASS>): <ERROR CLASS>
use
Link copied to clipboard
posix
inline fun <R> <ERROR CLASS><<ERROR CLASS>>.use(block: (<ERROR CLASS><<ERROR CLASS>>) -> R): R
write
Link copied to clipboard
posix
fun write(fildes: Int, buffer: Buffer): <ERROR CLASS>
fun write(fildes: Int, source: Memory, offset: Int, length: Int): Int
fun write(fildes: Int, source: Memory, offset: Long, length: Long): Long
writePacket
Link copied to clipboard
fun OutputStream.writePacket(packet: ByteReadPacket)
Write the whole packet to the stream
fun OutputStream.writePacket(builder: BytePacketBuilder.() -> Unit)
Write the whole packet to the stream once it is built via builder lambda
writerUTF8
Link copied to clipboard
fun BytePacketBuilder.writerUTF8(): Writer
Creates Writer that encodes all characters in UTF-8 encoding