PgByteWriter
Optimized buffer for building binary packets for the database. Allows reserving space for size and filling it later without memory copying.
Properties
Functions
Calculates the number of bytes added since reserveLengthInt was called and writes this value at the marker. Does not include the 4 bytes of the marker itself (in accordance with many PG structures).
Leaves 4 bytes of space for a number (e.g. packet size) and returns the index where this size should be written later.
A copy of what has been written so far.
Moves the write cursor, for the caller that has to go back and rewrite something it already emitted.
Appends bytes whole, with no length prefix — pair it with reserveLengthInt where the protocol wants one.
Appends a float8 as its IEEE 754 bit pattern.
Appends a float4 as its IEEE 754 bit pattern, which is the form PostgreSQL's binary format wants.
Appends a 16-bit integer, most significant byte first.