PostgreSQLPacketStream
classin packageklyn.databases.sql.postgresql
public class PostgreSQLPacketStream
PostgreSQLPacketStream

PostgreSQL packet stream for message-based protocol.

PostgreSQL protocol uses messages with format:

  • Type (1 byte, optional for startup)
  • Length (4 bytes, includes itself but not type)
  • Payload
Constructors
Modifier and Type Member Description
public PostgreSQLPacketStream No summary.
Methods
Modifier and Type Member Description
public close
close() as Void
Closes the stream.
public getLastMessageType
getLastMessageType() as Byte
Returns the last message type.
public readMessage
readMessage() as Byte[] throws SQLException
Reads a message with type byte.
public readStartupResponse
readStartupResponse() as Byte[] throws SQLException
Reads startup message response (no type byte).
public writeMessage
writeMessage(type as Int, payload as Byte[]) as Void throws SQLException
Writes a message with type byte.
public writeSslRequest
writeSslRequest() as Void throws SQLException
Writes SSL request.
public writeStartupMessage
writeStartupMessage(payload as Byte[]) as Void throws SQLException
Writes startup message (no type byte).