Documentation ¶
Overview ¶
Package readhelper provides a helper to read integer from reader.
Index ¶
- Variables
- func AcquireU64Bits() *[8]byte
- func AllocAtLeast(dst []byte, length int) []byte
- func AllocToAtLeast(dst []byte, length int) []byte
- func ReadBigEndianUint16(reader io.Reader) (uint16, error)
- func ReadBigEndianUint16WithBytes(reader io.Reader, p []byte) (uint16, error)
- func ReadBigEndianUint32(reader io.Reader) (uint32, error)
- func ReadBigEndianUint32WithBytes(reader io.Reader, p []byte) (uint32, error)
- func ReadBigEndianUint64(reader io.Reader) (uint64, error)
- func ReadBigEndianUint64WithBytes(reader io.Reader, p []byte) (uint64, error)
- func ReadToBytes(reader io.Reader, length int, buf []byte) error
- func ReadUint8(reader io.Reader) (uint8, error)
- func ReadUint8WithBytes(reader io.Reader, b []byte) (uint8, error)
- func ReleaseU64Bits(p *[8]byte)
Constants ¶
This section is empty.
Variables ¶
var ErrShortRead = errors.New("readhelper: short read")
ErrShortRead means cannot read more from reader.
Functions ¶
func AllocAtLeast ¶
AllocAtLeast guarantees allocate the []byte at least length.
func AllocToAtLeast ¶
AllocToAtLeast guarantees allocate the []byte at least length.
func ReadBigEndianUint16 ¶
ReadBigEndianUint16 reads uint16 from reader in big-endian byte order.
func ReadBigEndianUint16WithBytes ¶
ReadBigEndianUint16WithBytes reads uint16 from reader in big-endian byte order.
func ReadBigEndianUint32 ¶
ReadBigEndianUint32 reads uint32 from reader in big-endian byte order.
func ReadBigEndianUint32WithBytes ¶
ReadBigEndianUint32WithBytes reads uint32 from reader in big-endian byte order.
func ReadBigEndianUint64 ¶
ReadBigEndianUint64 reads uint32 from reader in big-endian byte order.
func ReadBigEndianUint64WithBytes ¶
ReadBigEndianUint64WithBytes reads uint32 from reader in big-endian byte order.
func ReadToBytes ¶
ReadToBytes fills the length of data to buffer.
func ReadUint8WithBytes ¶
ReadUint8WithBytes reads uint8 from reader.
Types ¶
This section is empty.