NewWireReader creates a new WireRW for reading from data previously written by either a valid Postgres server or a WireRW instance. This is intended strictly for reading the binary wire format that Postgres expects, and should not be used for internal read operations (utils.Reader is for internal us
(data []byte)
| 42 | // a WireRW instance. This is intended strictly for reading the binary wire format that Postgres expects, and should not |
| 43 | // be used for internal read operations (utils.Reader is for internal use). |
| 44 | func NewWireReader(data []byte) *WireRW { |
| 45 | return &WireRW{ |
| 46 | buf: bytes.NewBuffer(data), |
| 47 | readIdx: 0, |
| 48 | numSlice: make([]byte, 8), // 8 bytes will cover all floats and integers |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // ReadBool reads a 1-byte bool. |
| 53 | func (rw *WireRW) ReadBool() bool { |
no test coverage detected