Package-level declarations

Types

Link copied to clipboard
class PgByteWriter(initialCapacity: Int = 1024, maxCapacity: Int = 65536)

Optimized buffer for building binary packets for the database. Allows reserving space for size and filling it later without memory copying.

Link copied to clipboard
internal class PgInputStream(inputStream: InputStream)

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

Link copied to clipboard
internal class PgOutputStream(outputStream: OutputStream)

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

Link copied to clipboard
internal class PgStream(val host: String, val port: Int, val address: InetAddress, val loginTimeoutSecs: Int = 10, notificationBufferCapacity: Int = 256, val noticeHandler: NoticeHandler? = null, val sslConfiguration: SslConfiguration? = null, val cancelSignalTimeoutSecs: Int = 10) : AutoCloseable

Represents a connection stream to a PostgreSQL database. Handles reading and writing of PostgreSQL wire protocol messages.

Functions

Link copied to clipboard
fun ByteArray.getDoubleBE(offset: Int = 0): Double

Reads a float8 from the byte array starting at offset, as the IEEE 754 bit pattern it is sent as.

Link copied to clipboard
fun ByteArray.getFloatBE(offset: Int = 0): Float

Reads a float4 from the byte array starting at offset, its four bytes being the IEEE 754 bit pattern PostgreSQL's binary format sends.

Link copied to clipboard
fun ByteArray.getIntBE(offset: Int = 0): Int

Reads a 32-bit integer from the byte array starting at offset.

Link copied to clipboard
fun ByteArray.getLongBE(offset: Int = 0): Long

Reads a 64-bit integer from the byte array starting at offset.

Link copied to clipboard
fun ByteArray.getShortBE(offset: Int = 0): Short

Reads a 16-bit short integer from the byte array starting at offset.