v3

package module
v3.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MPL-2.0 Imports: 2 Imported by: 9

Documentation

Overview

Package v3 provides various utilities for manipulating bytes and bits easily

Index

Constants

This section is empty.

Variables

View Source
var (
	// BufferOverreadError represents an instance in which a read
	// attempted to read past the buffer itself
	BufferOverreadError = Error{
						// contains filtered or unexported fields
	}

	// BufferUnderreadError represents an instance in which a read
	// attempted to read before the buffer itself
	BufferUnderreadError = Error{
							// contains filtered or unexported fields
	}

	// BufferOverwriteError represents an instance in which a write
	// attempted to write past the buffer itself
	BufferOverwriteError = Error{
							// contains filtered or unexported fields
	}

	// BufferUnderwriteError represents an instance in which a write
	// attempted to write before the buffer itself
	BufferUnderwriteError = Error{
							// contains filtered or unexported fields
	}

	// BufferInvalidByteCountError represents an instance in which an
	// invalid byte count was passed to one of the buffer's methods
	BufferInvalidByteCountError = Error{
								// contains filtered or unexported fields
	}

	// BytesBufNegativeReadError represents an instance in which a
	// reader returned a negative count from its Read method
	BytesBufNegativeReadError = Error{
								// contains filtered or unexported fields
	}
)

Functions

func NewMiniBuffer

func NewMiniBuffer(out **MiniBuffer, slices ...[]byte)

NewMiniBuffer initilaizes a new MiniBuffer with the provided byte slice(s) stored inside in the order provided

Types

type Buffer

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

Buffer implements a buffer type in go that handles multiple types of data easily. it has overwrite/read checks for extra safety

func NewBuffer

func NewBuffer(slices ...[]byte) (buf *Buffer)

NewBuffer initilaizes a new Buffer with the provided byte slice(s) stored inside in the order provided

func (*Buffer) AfterBit

func (b *Buffer) AfterBit(off ...int64) int64

AfterBit returns the amount of bits located after the current bit position or the specified one

func (*Buffer) AfterByte

func (b *Buffer) AfterByte(off ...int64) int64

AfterByte returns the amount of bytes located after the current position or the specified one

func (*Buffer) AlignBit

func (b *Buffer) AlignBit()

AlignBit aligns the bit offset to the byte offset

func (*Buffer) AlignByte

func (b *Buffer) AlignByte()

AlignByte aligns the byte offset to the bit offset

func (*Buffer) BitCapacity

func (b *Buffer) BitCapacity() int64

BitCapacity returns the bit capacity of the buffer

func (*Buffer) BitOffset

func (b *Buffer) BitOffset() int64

BitOffset returns the current bit offset of the buffer

func (*Buffer) ByteCapacity

func (b *Buffer) ByteCapacity() int64

ByteCapacity returns the capacity of the buffer

func (*Buffer) ByteOffset

func (b *Buffer) ByteOffset() int64

ByteOffset returns the current offset of the buffer

func (*Buffer) Bytes

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

Bytes returns the internal byte slice of the buffer

func (*Buffer) ClearAllBits

func (b *Buffer) ClearAllBits()

ClearAllBits sets all of the buffer's bits to 0

func (*Buffer) ClearBit

func (b *Buffer) ClearBit(off int64)

ClearBit clears the bit located at the specified offset without modifying the internal offset value

func (*Buffer) ClearBitNext

func (b *Buffer) ClearBitNext()

ClearBitNext clears the next bit from the current offset and moves the offset forward a bit

func (*Buffer) FlipAllBits

func (b *Buffer) FlipAllBits()

FlipAllBits flips all of the buffer's bits

func (*Buffer) FlipBit

func (b *Buffer) FlipBit(off int64)

FlipBit flips the bit located at the specified offset without modifying the internal offset value

func (*Buffer) FlipBitNext

func (b *Buffer) FlipBitNext()

FlipBitNext flips the next bit from the current offset and moves the offset forward a bit

func (*Buffer) Grow

func (b *Buffer) Grow(n int64)

Grow makes the buffer's capacity bigger by n bytes

func (*Buffer) ReadBit

func (b *Buffer) ReadBit(off int64) byte

ReadBit returns the bit located at the specified offset without modifying the internal offset value

func (*Buffer) ReadBitNext

func (b *Buffer) ReadBitNext() (out byte)

ReadBitNext returns the next bit from the current offset and moves the offset forward a bit

func (*Buffer) ReadBits

func (b *Buffer) ReadBits(off, n int64) (out uint64)

ReadBits returns the next n bits from the specified offset without modifying the internal offset value

func (*Buffer) ReadBitsNext

func (b *Buffer) ReadBitsNext(n int64) (out uint64)

ReadBitsNext returns the next n bits from the current offset and moves the offset forward the amount of bits read

func (*Buffer) ReadByte

func (b *Buffer) ReadByte(off int64) byte

ReadByte returns the next byte from the specified offset without modifying the internal offset value

func (*Buffer) ReadByteNext

func (b *Buffer) ReadByteNext() (out byte)

ReadByteNext returns the next byte from the current offset and moves the offset forward a byte

func (*Buffer) ReadBytes

func (b *Buffer) ReadBytes(off, n int64) []byte

ReadBytes returns the next n bytes from the specified offset without modifying the internal offset value

func (*Buffer) ReadBytesNext

func (b *Buffer) ReadBytesNext(n int64) (out []byte)

ReadBytesNext returns the next n bytes from the current offset and moves the offset forward the amount of bytes read

func (*Buffer) ReadF32BE

func (b *Buffer) ReadF32BE(off, n int64) (out []float32)

ReadF32BE reads a slice of float32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadF32BENext

func (b *Buffer) ReadF32BENext(n int64) (out []float32)

ReadF32BENext reads a slice of float32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadF32LE

func (b *Buffer) ReadF32LE(off, n int64) (out []float32)

ReadF32LE reads a slice of float32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadF32LENext

func (b *Buffer) ReadF32LENext(n int64) (out []float32)

ReadF32LENext reads a slice of float32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadF64BE

func (b *Buffer) ReadF64BE(off, n int64) (out []float64)

ReadF64BE reads a slice of float64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadF64BENext

func (b *Buffer) ReadF64BENext(n int64) (out []float64)

ReadF64BENext reads a slice of float64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadF64LE

func (b *Buffer) ReadF64LE(off, n int64) (out []float64)

ReadF64LE reads a slice of float64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadF64LENext

func (b *Buffer) ReadF64LENext(n int64) (out []float64)

ReadF64LENext reads a slice of float64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI16BE

func (b *Buffer) ReadI16BE(off, n int64) (out []int16)

ReadI16BE reads a slice of int16s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadI16BENext

func (b *Buffer) ReadI16BENext(n int64) (out []int16)

ReadI16BENext reads a slice of int16s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI16LE

func (b *Buffer) ReadI16LE(off, n int64) (out []int16)

ReadI16LE reads a slice of int16s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadI16LENext

func (b *Buffer) ReadI16LENext(n int64) (out []int16)

ReadI16LENext reads a slice of int16s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI32BE

func (b *Buffer) ReadI32BE(off, n int64) (out []int32)

ReadI32BE reads a slice of int32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadI32BENext

func (b *Buffer) ReadI32BENext(n int64) (out []int32)

ReadI32BENext reads a slice of int32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI32LE

func (b *Buffer) ReadI32LE(off, n int64) (out []int32)

ReadI32LE reads a slice of int32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadI32LENext

func (b *Buffer) ReadI32LENext(n int64) (out []int32)

ReadI32LENext reads a slice of int32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI64BE

func (b *Buffer) ReadI64BE(off, n int64) (out []int64)

ReadI64BE reads a slice of int64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadI64BENext

func (b *Buffer) ReadI64BENext(n int64) (out []int64)

ReadI64BENext reads a slice of int64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadI64LE

func (b *Buffer) ReadI64LE(off, n int64) (out []int64)

ReadI64LE reads a slice of int64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadI64LENext

func (b *Buffer) ReadI64LENext(n int64) (out []int64)

ReadI64LENext reads a slice of int64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU16BE

func (b *Buffer) ReadU16BE(off, n int64) (out []uint16)

ReadU16BE reads a slice of uint16s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadU16BENext

func (b *Buffer) ReadU16BENext(n int64) (out []uint16)

ReadU16BENext reads a slice of uint16s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU16LE

func (b *Buffer) ReadU16LE(off, n int64) (out []uint16)

ReadU16LE reads a slice of uint16s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadU16LENext

func (b *Buffer) ReadU16LENext(n int64) (out []uint16)

ReadU16LENext reads a slice of uint16s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU32BE

func (b *Buffer) ReadU32BE(off, n int64) (out []uint32)

ReadU32BE reads a slice of uint32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadU32BENext

func (b *Buffer) ReadU32BENext(n int64) (out []uint32)

ReadU32BENext reads a slice of uint32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU32LE

func (b *Buffer) ReadU32LE(off, n int64) (out []uint32)

ReadU32LE reads a slice of uint32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadU32LENext

func (b *Buffer) ReadU32LENext(n int64) (out []uint32)

ReadU32LENext reads a slice of uint32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU64BE

func (b *Buffer) ReadU64BE(off, n int64) (out []uint64)

ReadU64BE reads a slice of uint64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) ReadU64BENext

func (b *Buffer) ReadU64BENext(n int64) (out []uint64)

ReadU64BENext reads a slice of uint64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) ReadU64LE

func (b *Buffer) ReadU64LE(off, n int64) (out []uint64)

ReadU64LE reads a slice of uint64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) ReadU64LENext

func (b *Buffer) ReadU64LENext(n int64) (out []uint64)

ReadU64LENext reads a slice of uint64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) Refresh

func (b *Buffer) Refresh()

Refresh updates the cached internal statistics of the buffer forcefully

func (*Buffer) Reset

func (b *Buffer) Reset()

Reset resets the entire buffer

func (*Buffer) SeekBit

func (b *Buffer) SeekBit(off int64, relative bool)

SeekBit seeks to bit position off of the the buffer relative to the current position or exact

func (*Buffer) SeekByte

func (b *Buffer) SeekByte(off int64, relative bool)

SeekByte seeks to position off of the buffer relative to the current position or exact

func (*Buffer) SetAllBits

func (b *Buffer) SetAllBits()

SetAllBits sets all of the buffer's bits to 1

func (*Buffer) SetBit

func (b *Buffer) SetBit(off int64)

SetBit sets the bit located at the specified offset without modifying the internal offset value

func (*Buffer) SetBitNext

func (b *Buffer) SetBitNext()

SetBitNext sets the next bit from the current offset and moves the offset forward a bit

func (*Buffer) SetBits

func (b *Buffer) SetBits(off int64, data uint64, n int64)

SetBits sets the next n bits from the specified offset without modifying the internal offset value

func (*Buffer) SetBitsNext

func (b *Buffer) SetBitsNext(data uint64, n int64)

SetBitsNext sets the next n bits from the current offset and moves the offset forward the amount of bits set

func (*Buffer) TruncateLeft

func (b *Buffer) TruncateLeft(n int64)

TruncateLeft truncates the buffer on the left side

func (*Buffer) TruncateRight

func (b *Buffer) TruncateRight(n int64)

TruncateRight truncates the buffer on the right side

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(off int64, data byte)

WriteByte writes a byte to the buffer at the specified offset without modifying the internal offset value

func (*Buffer) WriteByteNext

func (b *Buffer) WriteByteNext(data byte)

WriteByteNext writes a byte to the buffer at the current offset and moves the offset forward the amount of bytes written

func (*Buffer) WriteBytes

func (b *Buffer) WriteBytes(off int64, data []byte)

WriteBytes writes bytes to the buffer at the specified offset without modifying the internal offset value

func (*Buffer) WriteBytesNext

func (b *Buffer) WriteBytesNext(data []byte)

WriteBytesNext writes bytes to the buffer at the current offset and moves the offset forward the amount of bytes written

func (*Buffer) WriteF32BE

func (b *Buffer) WriteF32BE(off int64, data []float32)

WriteF32BE writes a slice of float32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteF32BENext

func (b *Buffer) WriteF32BENext(data []float32)

WriteF32BENext writes a slice of float32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteF32LE

func (b *Buffer) WriteF32LE(off int64, data []float32)

WriteF32LE writes a slice of float32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteF32LENext

func (b *Buffer) WriteF32LENext(data []float32)

WriteF32LENext writes a slice of float32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteF64BE

func (b *Buffer) WriteF64BE(off int64, data []float64)

WriteF64BE writes a slice of float64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteF64BENext

func (b *Buffer) WriteF64BENext(data []float64)

WriteF64BENext writes a slice of float64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteF64LE

func (b *Buffer) WriteF64LE(off int64, data []float64)

WriteF64LE writes a slice of float64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteF64LENext

func (b *Buffer) WriteF64LENext(data []float64)

WriteF64LENext writes a slice of float64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI16BE

func (b *Buffer) WriteI16BE(off int64, data []int16)

WriteI16BE writes a slice of int16s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteI16BENext

func (b *Buffer) WriteI16BENext(data []int16)

WriteI16BENext writes a slice of int16s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI16LE

func (b *Buffer) WriteI16LE(off int64, data []int16)

WriteI16LE writes a slice of int16s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteI16LENext

func (b *Buffer) WriteI16LENext(data []int16)

WriteI16LENext writes a slice of int16s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI32BE

func (b *Buffer) WriteI32BE(off int64, data []int32)

WriteI32BE writes a slice of int32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteI32BENext

func (b *Buffer) WriteI32BENext(data []int32)

WriteI32BENext writes a slice of int32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI32LE

func (b *Buffer) WriteI32LE(off int64, data []int32)

WriteI32LE writes a slice of int32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteI32LENext

func (b *Buffer) WriteI32LENext(data []int32)

WriteI32LENext writes a slice of int32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI64BE

func (b *Buffer) WriteI64BE(off int64, data []int64)

WriteI64BE writes a slice of int64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteI64BENext

func (b *Buffer) WriteI64BENext(data []int64)

WriteI64BENext writes a slice of int64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteI64LE

func (b *Buffer) WriteI64LE(off int64, data []int64)

WriteI64LE writes a slice of int64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteI64LENext

func (b *Buffer) WriteI64LENext(data []int64)

WriteI64LENext writes a slice of int64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU16BE

func (b *Buffer) WriteU16BE(off int64, data []uint16)

WriteU16BE writes a slice of uint16s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteU16BENext

func (b *Buffer) WriteU16BENext(data []uint16)

WriteU16BENext writes a slice of uint16s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU16LE

func (b *Buffer) WriteU16LE(off int64, data []uint16)

WriteU16LE writes a slice of uint16s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteU16LENext

func (b *Buffer) WriteU16LENext(data []uint16)

WriteU16LENext writes a slice of uint16s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU32BE

func (b *Buffer) WriteU32BE(off int64, data []uint32)

WriteU32BE writes a slice of uint32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteU32BENext

func (b *Buffer) WriteU32BENext(data []uint32)

WriteU32BENext writes a slice of uint32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU32LE

func (b *Buffer) WriteU32LE(off int64, data []uint32)

WriteU32LE writes a slice of uint32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteU32LENext

func (b *Buffer) WriteU32LENext(data []uint32)

WriteU32LENext writes a slice of uint32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU64BE

func (b *Buffer) WriteU64BE(off int64, data []uint64)

WriteU64BE writes a slice of uint64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*Buffer) WriteU64BENext

func (b *Buffer) WriteU64BENext(data []uint64)

WriteU64BENext writes a slice of uint64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*Buffer) WriteU64LE

func (b *Buffer) WriteU64LE(off int64, data []uint64)

WriteU64LE writes a slice of uint64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*Buffer) WriteU64LENext

func (b *Buffer) WriteU64LENext(data []uint64)

WriteU64LENext writes a slice of uint64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

type Error

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

Error implements a custom error type used in crunch

func (Error) Error

func (e Error) Error() string

Error formats the error held in a Error as a string

type MiniBuffer

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

MiniBuffer implements a fast and low-memory buffer type in go that handles multiple types of data easily. it lacks the overwrite/read and underwrite/read checks that Buffer has

func (*MiniBuffer) AfterBit

func (b *MiniBuffer) AfterBit(out *int64, off ...int64)

AfterBit stores the amount of bits located after the current bit position or the specified one in out

func (*MiniBuffer) AfterByte

func (b *MiniBuffer) AfterByte(out *int64, off ...int64)

AfterByte stores the amount of bytes located after the current position or the specified one in out

func (*MiniBuffer) AlignBit

func (b *MiniBuffer) AlignBit()

AlignBit aligns the bit offset to the byte offset

func (*MiniBuffer) AlignByte

func (b *MiniBuffer) AlignByte()

AlignByte aligns the byte offset to the bit offset

func (*MiniBuffer) BitCapacity

func (b *MiniBuffer) BitCapacity(out *int64)

BitCapacity stores the bit capacity of the buffer in out

func (*MiniBuffer) BitOffset

func (b *MiniBuffer) BitOffset(out *int64)

BitOffset stores the current bit offset of the buffer in out

func (*MiniBuffer) ByteCapacity

func (b *MiniBuffer) ByteCapacity(out *int64)

ByteCapacity stores the capacity of the buffer in out

func (*MiniBuffer) ByteOffset

func (b *MiniBuffer) ByteOffset(out *int64)

ByteOffset stores the current offset of the buffer in out

func (*MiniBuffer) Bytes

func (b *MiniBuffer) Bytes(out *[]byte)

Bytes stores the internal byte slice of the buffer in out

func (*MiniBuffer) ClearAllBits

func (b *MiniBuffer) ClearAllBits()

ClearAllBits sets all of the buffer's bits to 0

func (*MiniBuffer) ClearBit

func (b *MiniBuffer) ClearBit(off int64)

ClearBit clears the bit located at the specified offset without modifying the internal offset value

func (*MiniBuffer) ClearBitNext

func (b *MiniBuffer) ClearBitNext()

ClearBitNext clears the next bit from the current offset and moves the offset forward a bit

func (*MiniBuffer) FlipAllBits

func (b *MiniBuffer) FlipAllBits()

FlipAllBits flips all of the buffer's bits

func (*MiniBuffer) FlipBit

func (b *MiniBuffer) FlipBit(off int64)

FlipBit flips the bit located at the specified offset without modifying the internal offset value

func (*MiniBuffer) FlipBitNext

func (b *MiniBuffer) FlipBitNext()

FlipBitNext flips the next bit from the current offset and moves the offset forward a bit

func (*MiniBuffer) Grow

func (b *MiniBuffer) Grow(n int64)

Grow makes the buffer's capacity bigger by n bytes

func (*MiniBuffer) ReadBit

func (b *MiniBuffer) ReadBit(out *byte, off int64)

ReadBit stores the bit located at the specified offset without modifying the internal offset value in out

func (*MiniBuffer) ReadBitNext

func (b *MiniBuffer) ReadBitNext(out *byte)

ReadBitNext stores the next bit from the current offset and moves the offset forward a bit in out

func (*MiniBuffer) ReadBits

func (b *MiniBuffer) ReadBits(out *uint64, off, n int64)

ReadBits stores the next n bits from the specified offset without modifying the internal offset value in out

func (*MiniBuffer) ReadBitsNext

func (b *MiniBuffer) ReadBitsNext(out *uint64, n int64)

ReadBitsNext stores the next n bits from the current offset and moves the offset forward the amount of bits read in out

func (*MiniBuffer) ReadBytes

func (b *MiniBuffer) ReadBytes(out *[]byte, off, n int64)

ReadBytes stores the next n bytes from the specified offset without modifying the internal offset value in out

func (*MiniBuffer) ReadBytesNext

func (b *MiniBuffer) ReadBytesNext(out *[]byte, n int64)

ReadBytesNext stores the next n bytes from the current offset and moves the offset forward the amount of bytes read in out

func (*MiniBuffer) ReadF32BE

func (b *MiniBuffer) ReadF32BE(out *[]float32, off, n int64)

ReadF32BE reads a slice of float32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadF32BENext

func (b *MiniBuffer) ReadF32BENext(out *[]float32, n int64)

ReadF32BENext reads a slice of float32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadF32LE

func (b *MiniBuffer) ReadF32LE(out *[]float32, off, n int64)

ReadF32LE reads a slice of float32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadF32LENext

func (b *MiniBuffer) ReadF32LENext(out *[]float32, n int64)

ReadF32LENext reads a slice of float32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadF64BE

func (b *MiniBuffer) ReadF64BE(out *[]float64, off, n int64)

ReadF64BE reads a slice of float64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadF64BENext

func (b *MiniBuffer) ReadF64BENext(out *[]float64, n int64)

ReadF64BENext reads a slice of float64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadF64LE

func (b *MiniBuffer) ReadF64LE(out *[]float64, off, n int64)

ReadF64LE reads a slice of float64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadF64LENext

func (b *MiniBuffer) ReadF64LENext(out *[]float64, n int64)

ReadF64LENext reads a slice of float64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI16BE

func (b *MiniBuffer) ReadI16BE(out *[]int16, off, n int64)

ReadI16BE reads a slice of int16s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadI16BENext

func (b *MiniBuffer) ReadI16BENext(out *[]int16, n int64)

ReadI16BENext reads a slice of int16s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI16LE

func (b *MiniBuffer) ReadI16LE(out *[]int16, off, n int64)

ReadI16LE reads a slice of int16s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadI16LENext

func (b *MiniBuffer) ReadI16LENext(out *[]int16, n int64)

ReadI16LENext reads a slice of int16s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI32BE

func (b *MiniBuffer) ReadI32BE(out *[]int32, off, n int64)

ReadI32BE reads a slice of int32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadI32BENext

func (b *MiniBuffer) ReadI32BENext(out *[]int32, n int64)

ReadI32BENext reads a slice of int32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI32LE

func (b *MiniBuffer) ReadI32LE(out *[]int32, off, n int64)

ReadI32LE reads a slice of int32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadI32LENext

func (b *MiniBuffer) ReadI32LENext(out *[]int32, n int64)

ReadI32LENext reads a slice of int32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI64BE

func (b *MiniBuffer) ReadI64BE(out *[]int64, off, n int64)

ReadI64BE reads a slice of int64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadI64BENext

func (b *MiniBuffer) ReadI64BENext(out *[]int64, n int64)

ReadI64BENext reads a slice of int64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadI64LE

func (b *MiniBuffer) ReadI64LE(out *[]int64, off, n int64)

ReadI64LE reads a slice of int64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadI64LENext

func (b *MiniBuffer) ReadI64LENext(out *[]int64, n int64)

ReadI64LENext reads a slice of int64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU16BE

func (b *MiniBuffer) ReadU16BE(out *[]uint16, off, n int64)

ReadU16BE reads a slice of uint16s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadU16BENext

func (b *MiniBuffer) ReadU16BENext(out *[]uint16, n int64)

ReadU16BENext reads a slice of uint16s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU16LE

func (b *MiniBuffer) ReadU16LE(out *[]uint16, off, n int64)

ReadU16LE reads a slice of uint16s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadU16LENext

func (b *MiniBuffer) ReadU16LENext(out *[]uint16, n int64)

ReadU16LENext reads a slice of uint16s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU32BE

func (b *MiniBuffer) ReadU32BE(out *[]uint32, off, n int64)

ReadU32BE reads a slice of uint32s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadU32BENext

func (b *MiniBuffer) ReadU32BENext(out *[]uint32, n int64)

ReadU32BENext reads a slice of uint32s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU32LE

func (b *MiniBuffer) ReadU32LE(out *[]uint32, off, n int64)

ReadU32LE reads a slice of uint32s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadU32LENext

func (b *MiniBuffer) ReadU32LENext(out *[]uint32, n int64)

ReadU32LENext reads a slice of uint32s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU64BE

func (b *MiniBuffer) ReadU64BE(out *[]uint64, off, n int64)

ReadU64BE reads a slice of uint64s from the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) ReadU64BENext

func (b *MiniBuffer) ReadU64BENext(out *[]uint64, n int64)

ReadU64BENext reads a slice of uint64s from the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) ReadU64LE

func (b *MiniBuffer) ReadU64LE(out *[]uint64, off, n int64)

ReadU64LE reads a slice of uint64s from the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) ReadU64LENext

func (b *MiniBuffer) ReadU64LENext(out *[]uint64, n int64)

ReadU64LENext reads a slice of uint64s from the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) Refresh

func (b *MiniBuffer) Refresh()

Refresh updates the cached internal statistics of the buffer forcefully

func (*MiniBuffer) Reset

func (b *MiniBuffer) Reset()

Reset resets the entire buffer

func (*MiniBuffer) SeekBit

func (b *MiniBuffer) SeekBit(off int64, relative bool)

SeekBit seeks to bit position off of the the buffer relative to the current position or exact

func (*MiniBuffer) SeekByte

func (b *MiniBuffer) SeekByte(off int64, relative bool)

SeekByte seeks to position off of the buffer relative to the current position or exact

func (*MiniBuffer) SetAllBits

func (b *MiniBuffer) SetAllBits()

SetAllBits sets all of the buffer's bits to 1

func (*MiniBuffer) SetBit

func (b *MiniBuffer) SetBit(off int64)

SetBit sets the bit located at the specified offset without modifying the internal offset value

func (*MiniBuffer) SetBitNext

func (b *MiniBuffer) SetBitNext()

SetBitNext sets the next bit from the current offset and moves the offset forward a bit

func (*MiniBuffer) SetBits

func (b *MiniBuffer) SetBits(off int64, data uint64, n int64)

SetBits sets the next n bits from the specified offset without modifying the internal offset value

func (*MiniBuffer) SetBitsNext

func (b *MiniBuffer) SetBitsNext(data uint64, n int64)

SetBitsNext sets the next n bits from the current offset and moves the offset forward the amount of bits set

func (*MiniBuffer) TruncateLeft

func (b *MiniBuffer) TruncateLeft(n int64)

TruncateLeft truncates the buffer on the left side

func (*MiniBuffer) TruncateRight

func (b *MiniBuffer) TruncateRight(n int64)

TruncateRight truncates the buffer on the right side

func (*MiniBuffer) WriteBytes

func (b *MiniBuffer) WriteBytes(off int64, data []byte)

WriteBytes writes bytes to the buffer at the specified offset without modifying the internal offset value

func (*MiniBuffer) WriteBytesNext

func (b *MiniBuffer) WriteBytesNext(data []byte)

WriteBytesNext writes bytes to the buffer at the current offset and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteF32BE

func (b *MiniBuffer) WriteF32BE(off int64, data []float32)

WriteF32BE writes a slice of float32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteF32BENext

func (b *MiniBuffer) WriteF32BENext(data []float32)

WriteF32BENext writes a slice of float32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteF32LE

func (b *MiniBuffer) WriteF32LE(off int64, data []float32)

WriteF32LE writes a slice of float32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteF32LENext

func (b *MiniBuffer) WriteF32LENext(data []float32)

WriteF32LENext writes a slice of float32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteF64BE

func (b *MiniBuffer) WriteF64BE(off int64, data []float64)

WriteF64BE writes a slice of float64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteF64BENext

func (b *MiniBuffer) WriteF64BENext(data []float64)

WriteF64BENext writes a slice of float64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteF64LE

func (b *MiniBuffer) WriteF64LE(off int64, data []float64)

WriteF64LE writes a slice of float64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteF64LENext

func (b *MiniBuffer) WriteF64LENext(data []float64)

WriteF64LENext writes a slice of float64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI16BE

func (b *MiniBuffer) WriteI16BE(off int64, data []int16)

WriteI16BE writes a slice of int16s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteI16BENext

func (b *MiniBuffer) WriteI16BENext(data []int16)

WriteI16BENext writes a slice of int16s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI16LE

func (b *MiniBuffer) WriteI16LE(off int64, data []int16)

WriteI16LE writes a slice of int16s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteI16LENext

func (b *MiniBuffer) WriteI16LENext(data []int16)

WriteI16LENext writes a slice of int16s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI32BE

func (b *MiniBuffer) WriteI32BE(off int64, data []int32)

WriteI32BE writes a slice of int32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteI32BENext

func (b *MiniBuffer) WriteI32BENext(data []int32)

WriteI32BENext writes a slice of int32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI32LE

func (b *MiniBuffer) WriteI32LE(off int64, data []int32)

WriteI32LE writes a slice of int32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteI32LENext

func (b *MiniBuffer) WriteI32LENext(data []int32)

WriteI32LENext writes a slice of int32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI64BE

func (b *MiniBuffer) WriteI64BE(off int64, data []int64)

WriteI64BE writes a slice of int64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteI64BENext

func (b *MiniBuffer) WriteI64BENext(data []int64)

WriteI64BENext writes a slice of int64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteI64LE

func (b *MiniBuffer) WriteI64LE(off int64, data []int64)

WriteI64LE writes a slice of int64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteI64LENext

func (b *MiniBuffer) WriteI64LENext(data []int64)

WriteI64LENext writes a slice of int64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU16BE

func (b *MiniBuffer) WriteU16BE(off int64, data []uint16)

WriteU16BE writes a slice of uint16s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteU16BENext

func (b *MiniBuffer) WriteU16BENext(data []uint16)

WriteU16BENext writes a slice of uint16s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU16LE

func (b *MiniBuffer) WriteU16LE(off int64, data []uint16)

WriteU16LE writes a slice of uint16s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteU16LENext

func (b *MiniBuffer) WriteU16LENext(data []uint16)

WriteU16LENext writes a slice of uint16s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU32BE

func (b *MiniBuffer) WriteU32BE(off int64, data []uint32)

WriteU32BE writes a slice of uint32s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteU32BENext

func (b *MiniBuffer) WriteU32BENext(data []uint32)

WriteU32BENext writes a slice of uint32s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU32LE

func (b *MiniBuffer) WriteU32LE(off int64, data []uint32)

WriteU32LE writes a slice of uint32s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteU32LENext

func (b *MiniBuffer) WriteU32LENext(data []uint32)

WriteU32LENext writes a slice of uint32s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU64BE

func (b *MiniBuffer) WriteU64BE(off int64, data []uint64)

WriteU64BE writes a slice of uint64s to the buffer at the specified offset in big-endian without modifying the internal offset value

func (*MiniBuffer) WriteU64BENext

func (b *MiniBuffer) WriteU64BENext(data []uint64)

WriteU64BENext writes a slice of uint64s to the buffer at the current offset in big-endian and moves the offset forward the amount of bytes written

func (*MiniBuffer) WriteU64LE

func (b *MiniBuffer) WriteU64LE(off int64, data []uint64)

WriteU64LE writes a slice of uint64s to the buffer at the specified offset in little-endian without modifying the internal offset value

func (*MiniBuffer) WriteU64LENext

func (b *MiniBuffer) WriteU64LENext(data []uint64)

WriteU64LENext writes a slice of uint64s to the buffer at the current offset in little-endian and moves the offset forward the amount of bytes written

Jump to

Keyboard shortcuts

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