PgInputStream

internal class PgInputStream(inputStream: InputStream)

A highly optimized, buffered input stream tailored for the PostgreSQL wire protocol.

It provides specialized methods for efficiently reading protocol primitives like bytes, integers, shorts, and null-terminated C-style strings. Internal buffering is used to minimize network reads and object allocations.

Constructors

Link copied to clipboard
constructor(inputStream: InputStream)

Functions

Link copied to clipboard
fun changeStream(newStream: InputStream)
Link copied to clipboard
fun readByte(): Byte
Link copied to clipboard
fun readBytes(length: Int): ByteArray

Returns exactly the specified number of bytes.

Link copied to clipboard

Reads a null-terminated string.

Link copied to clipboard
fun readFully(bytes: ByteArray, length: Int = bytes.size)
Link copied to clipboard
fun readInt(): Int
Link copied to clipboard
Link copied to clipboard
fun skip(length: Int)

Advances past exactly length bytes without materializing them.