Documentation
¶
Index ¶
- Variables
- func BytesToUint16(v []byte) uint16
- func BytesToUint32(v []byte) uint32
- func BytesToUint64(v []byte) uint64
- func FillBytes(r io.Reader, bs []byte) (int64, error)
- func ReadBool(r io.Reader) (bool, int64, error)
- func ReadBytes(r io.Reader) ([]byte, int64, error)
- func ReadString(r io.Reader) (string, int64, error)
- func ReadUint16(r io.Reader) (uint16, int64, error)
- func ReadUint32(r io.Reader) (uint32, int64, error)
- func ReadUint64(r io.Reader) (uint64, int64, error)
- func ReadUint8(r io.Reader) (uint8, int64, error)
- func Uint16ToBytes(v uint16) []byte
- func Uint32ToBytes(v uint32) []byte
- func Uint48ToBytes(a uint32, b uint16) []byte
- func Uint64ToBytes(v uint64) []byte
- func WriteBool(w io.Writer, b bool) (int64, error)
- func WriteBytes(w io.Writer, bs []byte) (int64, error)
- func WriteString(w io.Writer, str string) (int64, error)
- func WriteUint16(w io.Writer, num uint16) (int64, error)
- func WriteUint32(w io.Writer, num uint32) (int64, error)
- func WriteUint64(w io.Writer, num uint64) (int64, error)
- func WriteUint8(w io.Writer, num uint8) (int64, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidLength = errors.New("invalid length")
)
util errors
Functions ¶
func BytesToUint16 ¶
BytesToUint16 returns a uint16 number of the byte array
func BytesToUint32 ¶
BytesToUint32 returns a uint32 number of the byte array
func BytesToUint64 ¶
BytesToUint64 returns a uint64 number of the byte array
func ReadString ¶
ReadString reads a string array from the reader
func ReadUint16 ¶
ReadUint16 reads a uint16 number from the reader
func ReadUint32 ¶
ReadUint32 reads a uint32 number from the reader
func ReadUint64 ¶
ReadUint64 reads a uint64 number from the reader
func Uint16ToBytes ¶
Uint16ToBytes returns a byte array of the uint16 number
func Uint32ToBytes ¶
Uint32ToBytes returns a byte array of the uint32 number
func Uint48ToBytes ¶
Uint48ToBytes returns a byte array of the uint32 number and the uint16 number
func Uint64ToBytes ¶
Uint64ToBytes returns a byte array of the uint64 number
func WriteBytes ¶
WriteBytes writes the byte array bytes with the var-length-bytes to the writer
func WriteString ¶
WriteString writes the string with the var-length-byte to the writer
func WriteUint16 ¶
WriteUint16 writes the uint16 number to the writer
func WriteUint32 ¶
WriteUint32 writes the uint32 number to the writer
func WriteUint64 ¶
WriteUint64 writes the uint64 number to the writer
Types ¶
This section is empty.