readhelper

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 1

README

readhelper-go

readhelper-go provides a helper to read integer from reader.

Documentation

Overview

Package readhelper provides a helper to read integer from reader.

Index

Constants

This section is empty.

Variables

View Source
var ErrShortRead = errors.New("readhelper: short read")

ErrShortRead means cannot read more from reader.

Functions

func AcquireU64Bits

func AcquireU64Bits() *[8]byte

AcquireU64Bits acquires *[8]byte.

func AllocAtLeast

func AllocAtLeast(dst []byte, length int) []byte

AllocAtLeast guarantees allocate the []byte at least length.

func AllocToAtLeast

func AllocToAtLeast(dst []byte, length int) []byte

AllocToAtLeast guarantees allocate the []byte at least length.

func ReadBigEndianUint16

func ReadBigEndianUint16(reader io.Reader) (uint16, error)

ReadBigEndianUint16 reads uint16 from reader in big-endian byte order.

func ReadBigEndianUint16WithBytes

func ReadBigEndianUint16WithBytes(reader io.Reader, p []byte) (uint16, error)

ReadBigEndianUint16WithBytes reads uint16 from reader in big-endian byte order.

func ReadBigEndianUint32

func ReadBigEndianUint32(reader io.Reader) (uint32, error)

ReadBigEndianUint32 reads uint32 from reader in big-endian byte order.

func ReadBigEndianUint32WithBytes

func ReadBigEndianUint32WithBytes(reader io.Reader, p []byte) (uint32, error)

ReadBigEndianUint32WithBytes reads uint32 from reader in big-endian byte order.

func ReadBigEndianUint64

func ReadBigEndianUint64(reader io.Reader) (uint64, error)

ReadBigEndianUint64 reads uint32 from reader in big-endian byte order.

func ReadBigEndianUint64WithBytes

func ReadBigEndianUint64WithBytes(reader io.Reader, p []byte) (uint64, error)

ReadBigEndianUint64WithBytes reads uint32 from reader in big-endian byte order.

func ReadToBytes

func ReadToBytes(reader io.Reader, length int, buf []byte) error

ReadToBytes fills the length of data to buffer.

func ReadUint8

func ReadUint8(reader io.Reader) (uint8, error)

ReadUint8 reads uint8 from reader.

func ReadUint8WithBytes

func ReadUint8WithBytes(reader io.Reader, b []byte) (uint8, error)

ReadUint8WithBytes reads uint8 from reader.

func ReleaseU64Bits

func ReleaseU64Bits(p *[8]byte)

ReleaseU64Bits release *[8]byte.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL