bitflux

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

BitFlux

BitFlux is a lightweight library designed to simply custom packet generation and binary serialization. With a focus on flexibility and ease of use, BitFlux provides low-level control over binary data layouts while maintaining focusing on a straightforward API.

Goals

  • Intuitive API: Read and Write data with simple methods like WriteUint32, ReadFloat32
  • Endianness Support: Seamlessly handle both little-endian and big-endian formats for all supported types. Separate functions are provided for each format, allowing packets containing fields of both formats.
  • Custom Serialization: Tailored for custom binary serialization purposes.
  • Lightweight Design: No external dependencies.

Installation

go get github.com/jon-ski/bitflux

Quick Start

package main

import (
  "fmt"
  "log"
  
  "github.com/jon-ski/bitflux"
)

func main() {
  var buf bitflux.Buffer
  buf.WriteLUint16(1_234) // Little-Endian 16-bit 1234 (d2 04)
  buf.WriteBUint32(78_910) // Little-Endian 32-bit 78910 (00 01 34 3e)
  if buf.Err() != nil {
    // buf will keep track of the last error and will
    // nop on new calls if an error has occurred
    // 
    // Alternatively, functions that can error return an error.
    log.Fatalf("unexpected error: %w", buf.Err())
  }
  fmt.Printf("% 2x\n", buf.Bytes())
  // d2 04 00 01 34 3e
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Le = new(le) // Little-Endian functions
	Be = new(be) // Big-Endian functions
)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. These global variables will be removed in a future version.

Functions

This section is empty.

Types

type Buffer deprecated

type Buffer struct {
	// contains filtered or unexported fields
}

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. Buffer will be removed in a future version. Buffer wraps `bytes.Buffer` and provides serialization methods on top of it.

func NewBuffer deprecated

func NewBuffer(buf []byte) *Buffer

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. NewBuffer will be removed in a future version. NewBuffer creates an initialized internal buffer from `buf`. Useful as a reader on an existing buffer.

func (*Buffer) Bytes deprecated

func (b *Buffer) Bytes() []byte

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. Bytes will be removed in a future version. Bytes returns the bytes buffered.

func (*Buffer) Err deprecated

func (b *Buffer) Err() error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. Err will be removed in a future version. Err returns an error if an error has occurred on the buffer

func (*Buffer) Read deprecated

func (b *Buffer) Read(p []byte) (n int, err error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. Read will be removed in a future version. Read reads into p bytes and returns the number of bytes read and an error, if any. Will NOP if the buffer has stored an error.

func (*Buffer) ReadBFloat32 deprecated

func (b *Buffer) ReadBFloat32() (float32, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBFloat32 will be removed in a future version. ReadBFloat32 reads a float32 (big-endian) from the underlying buffer.

func (*Buffer) ReadBFloat64 deprecated added in v0.1.2

func (b *Buffer) ReadBFloat64() (float64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBFloat64 will be removed in a future version. ReadBFloat64 reads a float64 (big-endian) from the underlying buffer.

func (*Buffer) ReadBUint16 deprecated

func (b *Buffer) ReadBUint16() (uint16, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBUint16 will be removed in a future version. ReadBUint16 reads a uint16 (big-endian) from the underlying buffer.

func (*Buffer) ReadBUint32 deprecated

func (b *Buffer) ReadBUint32() (uint32, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBUint32 will be removed in a future version. ReadBUint32 reads a uint32 (big-endian) from the underlying buffer.

func (*Buffer) ReadBUint64 deprecated

func (b *Buffer) ReadBUint64() (uint64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBUint64 will be removed in a future version. ReadBUint64 reads a uint64 (big-endian) from the underlying buffer.

func (*Buffer) ReadBinary deprecated added in v0.2.0

func (b *Buffer) ReadBinary(u encoding.BinaryUnmarshaler, n int) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadBinary will be removed in a future version. ReadBinary reads exactly n bytes and calls UnmarshalBinary.

func (*Buffer) ReadByte deprecated

func (b *Buffer) ReadByte() (byte, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadByte will be removed in a future version. ReadByte reads a single byte from the underlying buffer.

func (*Buffer) ReadFrom deprecated added in v0.2.0

func (b *Buffer) ReadFrom(r io.Reader) (int64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadFrom will be removed in a future version.

func (*Buffer) ReadLFloat32 deprecated

func (b *Buffer) ReadLFloat32() (float32, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadLFloat32 will be removed in a future version. ReadLFloat32 reads a float32 (little-endian) from the underlying buffer.

func (*Buffer) ReadLFloat64 deprecated added in v0.1.2

func (b *Buffer) ReadLFloat64() (float64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadLFloat64 will be removed in a future version. ReadLFloat64 reads a float64 (little-endian) from the underlying buffer.

func (*Buffer) ReadLUint16 deprecated

func (b *Buffer) ReadLUint16() (uint16, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadLUint16 will be removed in a future version. ReadLUint16 reads a uint16 (little-endian) from the underlying buffer.

func (*Buffer) ReadLUint32 deprecated

func (b *Buffer) ReadLUint32() (uint32, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadLUint32 will be removed in a future version. ReadLUint32 reads a uint32 (little-endian) from the underlying buffer.

func (*Buffer) ReadLUint64 deprecated

func (b *Buffer) ReadLUint64() (uint64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadLUint64 will be removed in a future version. ReadLUint64 reads a uint64 (little-endian) from the underlying buffer.

func (*Buffer) ReadUint8 deprecated

func (b *Buffer) ReadUint8() (uint8, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. ReadUint8 will be removed in a future version. ReadUint8 reads a single uint8 (byte) from the underlying buffer.

func (*Buffer) Write deprecated

func (b *Buffer) Write(p []byte) (n int, err error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. Write will be removed in a future version. Write writes the contents of p to the underlying buffer. Will NOP if Buffer has stored an error and return that error.

func (*Buffer) WriteBFloat32 deprecated

func (b *Buffer) WriteBFloat32(v float32) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBFloat32 will be removed in a future version. WriteBFloat32 writes a float32 (big-endian) to the underlying buffer.

func (*Buffer) WriteBFloat64 deprecated

func (b *Buffer) WriteBFloat64(v float64) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBFloat64 will be removed in a future version. WriteBFloat64 writes a float64 (big-endian) to the underlying buffer.

func (*Buffer) WriteBUint16 deprecated

func (b *Buffer) WriteBUint16(v uint16) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBUint16 will be removed in a future version. WriteBUint16 writes a uint16 (big-endian) to the underlying buffer.

func (*Buffer) WriteBUint32 deprecated

func (b *Buffer) WriteBUint32(v uint32) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBUint32 will be removed in a future version. WriteBUint32 writes a uint32 (big-endian) to the underlying buffer.

func (*Buffer) WriteBUint64 deprecated

func (b *Buffer) WriteBUint64(v uint64) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBUint64 will be removed in a future version. WriteBUint64 writes a uint64 (big-endian) to the underlying buffer.

func (*Buffer) WriteBinary deprecated added in v0.2.0

func (b *Buffer) WriteBinary(m encoding.BinaryMarshaler) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteBinary will be removed in a future version. WriteBinary writes raw MarshalBinary bytes. No length prefix.

func (*Buffer) WriteByte deprecated

func (b *Buffer) WriteByte(v byte) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteByte will be removed in a future version. WriteByte writes a byte to the underlying buffer.

func (*Buffer) WriteLFloat32 deprecated

func (b *Buffer) WriteLFloat32(v float32) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteLFloat32 will be removed in a future version. WriteLFloat32 writes a float32 (little-endian) to the underlying buffer.

func (*Buffer) WriteLFloat64 deprecated

func (b *Buffer) WriteLFloat64(v float64) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteLFloat64 will be removed in a future version. WriteLFloat64 writes a float64 (little-endian) to the underlying buffer.

func (*Buffer) WriteLUint16 deprecated

func (b *Buffer) WriteLUint16(v uint16) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteLUint16 will be removed in a future version. WriteLUint16 writes a uint16 (little-endian) to the underlying buffer.

func (*Buffer) WriteLUint32 deprecated

func (b *Buffer) WriteLUint32(v uint32) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteLUint32 will be removed in a future version. WriteLUint32 writes a uint32 (little-endian) to the underlying buffer.

func (*Buffer) WriteLUint64 deprecated

func (b *Buffer) WriteLUint64(v uint64) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteLUint64 will be removed in a future version. WriteLUint64 writes a uint64 (little-endian) to the underlying buffer.

func (*Buffer) WriteString deprecated

func (b *Buffer) WriteString(v string) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteString will be removed in a future version. WriteString writes a string to the underlying buffer.

func (*Buffer) WriteTo deprecated added in v0.2.0

func (b *Buffer) WriteTo(w io.Writer) (int64, error)

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteTo will be removed in a future version.

func (*Buffer) WriteUint8 deprecated

func (b *Buffer) WriteUint8(v uint8) error

Deprecated: Use EncLE/DecLE and EncBE/DecBE instead. WriteUint8 will be removed in a future version. WriteUint8 writes a uint8 to the underlying buffer.

type DecBE added in v0.2.0

type DecBE struct {
	R   io.Reader // The underlying reader to decode data from
	N   int64     // Number of bytes read
	Err error     // First error encountered during decoding
}

DecBE is a big-endian binary decoder that reads data from an io.Reader. It tracks the number of bytes read and any errors that occur during decoding.

func NewDecBE added in v0.2.0

func NewDecBE(r io.Reader) *DecBE

NewDecBE creates a new big-endian decoder that reads from the provided io.Reader.

func (*DecBE) Bytes added in v0.2.0

func (d *DecBE) Bytes(n int) []byte

Bytes reads n bytes from the decoder and returns them as a byte slice.

func (*DecBE) F32 added in v0.2.0

func (d *DecBE) F32() float32

F32 decodes a float32 value from big-endian format using IEEE 754 representation.

func (*DecBE) F64 added in v0.2.0

func (d *DecBE) F64() float64

F64 decodes a float64 value from big-endian format using IEEE 754 representation.

func (*DecBE) FromRF added in v0.2.0

func (d *DecBE) FromRF(r io.ReaderFrom)

FromRF calls ReadFrom on the provided ReaderFrom and updates the decoder's byte count and error state.

func (*DecBE) I16 added in v0.2.0

func (d *DecBE) I16() int16

I16 decodes an int16 value from big-endian format.

func (*DecBE) I32 added in v0.2.0

func (d *DecBE) I32() int32

I32 decodes an int32 value from big-endian format.

func (*DecBE) I64 added in v0.2.0

func (d *DecBE) I64() int64

I64 decodes an int64 value from big-endian format.

func (*DecBE) I8 added in v0.2.0

func (d *DecBE) I8() int8

I8 decodes an int8 value from big-endian format.

func (*DecBE) ReadAll added in v0.2.3

func (d *DecBE) ReadAll() []byte

ReadAll reads all remaining bytes from the decoder until EOF. It updates the decoder's byte count and error state.

func (*DecBE) Skip added in v0.2.0

func (d *DecBE) Skip(n int)

Skip discards n bytes from the decoder without storing them.

func (*DecBE) U16 added in v0.2.0

func (d *DecBE) U16() uint16

U16 decodes a uint16 value from big-endian format.

func (*DecBE) U32 added in v0.2.0

func (d *DecBE) U32() uint32

U32 decodes a uint32 value from big-endian format.

func (*DecBE) U64 added in v0.2.0

func (d *DecBE) U64() uint64

U64 decodes a uint64 value from big-endian format.

func (*DecBE) U8 added in v0.2.0

func (d *DecBE) U8() uint8

U8 decodes a uint8 value from big-endian format.

func (*DecBE) Unmarshal added in v0.2.0

func (d *DecBE) Unmarshal(u encoding.BinaryUnmarshaler, n int)

Unmarshal reads n bytes and calls UnmarshalBinary on the provided BinaryUnmarshaler. It updates the decoder's error state if unmarshaling fails.

type DecLE added in v0.2.0

type DecLE struct {
	R   io.Reader // The underlying reader to decode data from
	N   int64     // Number of bytes read
	Err error     // First error encountered during decoding
}

DecLE is a little-endian binary decoder that reads data from an io.Reader. It tracks the number of bytes read and any errors that occur during decoding.

func NewDecLE added in v0.2.0

func NewDecLE(r io.Reader) *DecLE

NewDecLE creates a new little-endian decoder that reads from the provided io.Reader.

func (*DecLE) Bytes added in v0.2.0

func (d *DecLE) Bytes(n int) []byte

Bytes reads n bytes from the decoder and returns them as a byte slice.

func (*DecLE) F32 added in v0.2.0

func (d *DecLE) F32() float32

F32 decodes a float32 value from little-endian format using IEEE 754 representation.

func (*DecLE) F64 added in v0.2.0

func (d *DecLE) F64() float64

F64 decodes a float64 value from little-endian format using IEEE 754 representation.

func (*DecLE) FromRF added in v0.2.0

func (d *DecLE) FromRF(r io.ReaderFrom)

FromRF calls ReadFrom on the provided ReaderFrom and updates the decoder's byte count and error state.

func (*DecLE) I16 added in v0.2.0

func (d *DecLE) I16() int16

I16 decodes an int16 value from little-endian format.

func (*DecLE) I32 added in v0.2.0

func (d *DecLE) I32() int32

I32 decodes an int32 value from little-endian format.

func (*DecLE) I64 added in v0.2.0

func (d *DecLE) I64() int64

I64 decodes an int64 value from little-endian format.

func (*DecLE) I8 added in v0.2.0

func (d *DecLE) I8() int8

I8 decodes an int8 value from little-endian format.

func (*DecLE) ReadAll added in v0.2.3

func (d *DecLE) ReadAll() []byte

ReadAll reads all remaining bytes from the decoder until EOF. It updates the decoder's byte count and error state.

func (*DecLE) Skip added in v0.2.0

func (d *DecLE) Skip(n int)

Skip discards n bytes from the decoder without storing them.

func (*DecLE) U16 added in v0.2.0

func (d *DecLE) U16() uint16

U16 decodes a uint16 value from little-endian format.

func (*DecLE) U32 added in v0.2.0

func (d *DecLE) U32() uint32

U32 decodes a uint32 value from little-endian format.

func (*DecLE) U64 added in v0.2.0

func (d *DecLE) U64() uint64

U64 decodes a uint64 value from little-endian format.

func (*DecLE) U8 added in v0.2.0

func (d *DecLE) U8() uint8

U8 decodes a uint8 value from little-endian format.

func (*DecLE) Unmarshal added in v0.2.0

func (d *DecLE) Unmarshal(u encoding.BinaryUnmarshaler, n int)

Unmarshal reads n bytes and calls UnmarshalBinary on the provided BinaryUnmarshaler. It updates the decoder's error state if unmarshaling fails.

type EncBE added in v0.2.1

type EncBE struct {
	W   io.Writer // The underlying writer to encode data to
	N   int64     // Number of bytes written
	Err error     // First error encountered during encoding
}

EncBE is a big-endian binary encoder that writes data to an io.Writer. It tracks the number of bytes written and any errors that occur during encoding.

func NewEncBE added in v0.2.1

func NewEncBE(w io.Writer) *EncBE

NewEncBE creates a new big-endian encoder that writes to the provided io.Writer.

func NewEncBEBuffer added in v0.2.2

func NewEncBEBuffer() *EncBE

NewEncBEBuffer creates an encoder that writes to a new bytes.Buffer

func NewEncBEFromBytes added in v0.2.2

func NewEncBEFromBytes(data []byte) *EncBE

NewEncBEFromBytes creates an encoder that writes to a buffer initialized with existing data

func NewEncBEWithCapacity added in v0.2.2

func NewEncBEWithCapacity(cap int) *EncBE

NewEncBEWithCapacity creates an encoder that writes to a buffer with pre-allocated capacity

func (*EncBE) F32 added in v0.2.1

func (e *EncBE) F32(v float32)

F32 encodes a float32 value in big-endian format using IEEE 754 representation.

func (*EncBE) F64 added in v0.2.1

func (e *EncBE) F64(v float64)

F64 encodes a float64 value in big-endian format using IEEE 754 representation.

func (*EncBE) I16 added in v0.2.1

func (e *EncBE) I16(v int16)

I16 encodes an int16 value in big-endian format.

func (*EncBE) I32 added in v0.2.1

func (e *EncBE) I32(v int32)

I32 encodes an int32 value in big-endian format.

func (*EncBE) I64 added in v0.2.1

func (e *EncBE) I64(v int64)

I64 encodes an int64 value in big-endian format.

func (*EncBE) I8 added in v0.2.1

func (e *EncBE) I8(v int8)

I8 encodes an int8 value in big-endian format.

func (*EncBE) Marshal added in v0.2.1

func (e *EncBE) Marshal(m encoding.BinaryMarshaler)

Marshal calls MarshalBinary on the provided BinaryMarshaler and writes the result to the encoder. It updates the encoder's byte count and error state.

func (*EncBE) To added in v0.2.1

func (e *EncBE) To(w io.WriterTo)

To calls WriteTo on the provided WriterTo and updates the encoder's byte count and error state.

func (*EncBE) U16 added in v0.2.1

func (e *EncBE) U16(v uint16)

U16 encodes a uint16 value in big-endian format.

func (*EncBE) U32 added in v0.2.1

func (e *EncBE) U32(v uint32)

U32 encodes a uint32 value in big-endian format.

func (*EncBE) U64 added in v0.2.1

func (e *EncBE) U64(v uint64)

U64 encodes a uint64 value in big-endian format.

func (*EncBE) U8 added in v0.2.1

func (e *EncBE) U8(v uint8)

U8 encodes a uint8 value in big-endian format.

func (*EncBE) Write added in v0.2.1

func (e *EncBE) Write(p []byte)

Write writes raw bytes to the encoder.

type EncLE added in v0.2.1

type EncLE struct {
	W   io.Writer // The underlying writer to encode data to
	N   int64     // Number of bytes written
	Err error     // First error encountered during encoding
}

EncLE is a little-endian binary encoder that writes data to an io.Writer. It tracks the number of bytes written and any errors that occur during encoding.

func NewEncLE added in v0.2.1

func NewEncLE(w io.Writer) *EncLE

NewEncLE creates a new little-endian encoder that writes to the provided io.Writer.

func NewEncLEBuffer added in v0.2.2

func NewEncLEBuffer() *EncLE

NewEncLEBuffer creates an encoder that writes to a new bytes.Buffer

func NewEncLEFromBytes added in v0.2.2

func NewEncLEFromBytes(data []byte) *EncLE

NewEncLEFromBytes creates an encoder that writes to a buffer initialized with existing data

func NewEncLEWithCapacity added in v0.2.2

func NewEncLEWithCapacity(cap int) *EncLE

NewEncLEWithCapacity creates an encoder that writes to a buffer with pre-allocated capacity

func (*EncLE) F32 added in v0.2.1

func (e *EncLE) F32(v float32)

F32 encodes a float32 value in little-endian format using IEEE 754 representation.

func (*EncLE) F64 added in v0.2.1

func (e *EncLE) F64(v float64)

F64 encodes a float64 value in little-endian format using IEEE 754 representation.

func (*EncLE) I16 added in v0.2.1

func (e *EncLE) I16(v int16)

I16 encodes an int16 value in little-endian format.

func (*EncLE) I32 added in v0.2.1

func (e *EncLE) I32(v int32)

I32 encodes an int32 value in little-endian format.

func (*EncLE) I64 added in v0.2.1

func (e *EncLE) I64(v int64)

I64 encodes an int64 value in little-endian format.

func (*EncLE) I8 added in v0.2.1

func (e *EncLE) I8(v int8)

I8 encodes an int8 value in little-endian format.

func (*EncLE) Marshal added in v0.2.1

func (e *EncLE) Marshal(m encoding.BinaryMarshaler)

Marshal calls MarshalBinary on the provided BinaryMarshaler and writes the result to the encoder. It updates the encoder's byte count and error state.

func (*EncLE) To added in v0.2.1

func (e *EncLE) To(w io.WriterTo)

To calls WriteTo on the provided WriterTo and updates the encoder's byte count and error state.

func (*EncLE) U16 added in v0.2.1

func (e *EncLE) U16(v uint16)

U16 encodes a uint16 value in little-endian format.

func (*EncLE) U32 added in v0.2.1

func (e *EncLE) U32(v uint32)

U32 encodes a uint32 value in little-endian format.

func (*EncLE) U64 added in v0.2.1

func (e *EncLE) U64(v uint64)

U64 encodes a uint64 value in little-endian format.

func (*EncLE) U8 added in v0.2.1

func (e *EncLE) U8(v uint8)

U8 encodes a uint8 value in little-endian format.

func (*EncLE) Write added in v0.2.1

func (e *EncLE) Write(p []byte)

Write writes raw bytes to the encoder.

type Reader deprecated

type Reader struct {
	// contains filtered or unexported fields
}

Deprecated: Use DecLE/DecBE instead. Reader will be removed in a future version. Reader wraps an io.Reader and provides serialization methods on top of it.

func NewReader deprecated

func NewReader(r io.Reader) *Reader

Deprecated: Use NewDecLE/NewDecBE instead. NewReader will be removed in a future version. NewReader creates a new Reader that wraps the provided io.Reader.

func (*Reader) Read deprecated

func (r *Reader) Read(p []byte) (n int, err error)

Deprecated: Use DecLE/DecBE instead. Read will be removed in a future version. Read reads into p bytes and returns the number of bytes read and an error, if any. Will NOP if the reader has stored an error.

func (*Reader) ReadBFloat32 deprecated

func (r *Reader) ReadBFloat32() (float32, error)

Deprecated: Use DecLE/DecBE instead. ReadBFloat32 will be removed in a future version. ReadBFloat32 reads a float32 (big-endian) from the underlying reader.

func (*Reader) ReadBFloat64 deprecated

func (r *Reader) ReadBFloat64() (float64, error)

Deprecated: Use DecLE/DecBE instead. ReadBFloat64 will be removed in a future version. ReadBFloat64 reads a float64 (big-endian) from the underlying reader.

func (*Reader) ReadBUint16 deprecated

func (r *Reader) ReadBUint16() (uint16, error)

Deprecated: Use DecLE/DecBE instead. ReadBUint16 will be removed in a future version. ReadBUint16 reads a uint16 (big-endian) from the underlying reader.

func (*Reader) ReadBUint32 deprecated

func (r *Reader) ReadBUint32() (uint32, error)

Deprecated: Use DecLE/DecBE instead. ReadBUint32 will be removed in a future version. ReadBUint32 reads a uint32 (big-endian) from the underlying reader.

func (*Reader) ReadBUint64 deprecated

func (r *Reader) ReadBUint64() (uint64, error)

Deprecated: Use DecLE/DecBE instead. ReadBUint64 will be removed in a future version. ReadBUint64 reads a uint64 (big-endian) from the underlying reader.

func (*Reader) ReadByte deprecated

func (r *Reader) ReadByte() (byte, error)

Deprecated: Use DecLE/DecBE instead. ReadByte will be removed in a future version. ReadByte reads a single byte from the underlying reader.

func (*Reader) ReadLFloat32 deprecated

func (r *Reader) ReadLFloat32() (float32, error)

Deprecated: Use DecLE/DecBE instead. ReadLFloat32 will be removed in a future version. ReadLFloat32 reads a float32 (little-endian) from the underlying reader.

func (*Reader) ReadLFloat64 deprecated

func (r *Reader) ReadLFloat64() (float64, error)

Deprecated: Use DecLE/DecBE instead. ReadLFloat64 will be removed in a future version. ReadLFloat64 reads a float64 (little-endian) from the underlying reader.

func (*Reader) ReadLUint16 deprecated

func (r *Reader) ReadLUint16() (uint16, error)

Deprecated: Use DecLE/DecBE instead. ReadLUint16 will be removed in a future version. ReadLUint16 reads a uint16 (little-endian) from the underlying reader.

func (*Reader) ReadLUint32 deprecated

func (r *Reader) ReadLUint32() (uint32, error)

Deprecated: Use DecLE/DecBE instead. ReadLUint32 will be removed in a future version. ReadLUint32 reads a uint32 (little-endian) from the underlying reader.

func (*Reader) ReadLUint64 deprecated

func (r *Reader) ReadLUint64() (uint64, error)

Deprecated: Use DecLE/DecBE instead. ReadLUint64 will be removed in a future version. ReadLUint64 reads a uint64 (little-endian) from the underlying reader.

func (*Reader) ReadUint8 deprecated

func (r *Reader) ReadUint8() (uint8, error)

Deprecated: Use DecLE/DecBE instead. ReadUint8 will be removed in a future version. ReadUint8 reads a single uint8 (byte) from the underlying reader.

Jump to

Keyboard shortcuts

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