bitread

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copy paste of https://github.com/markus-wa/demoinfocs-golang/blob/master/internal/bitread/bitread.go We need it to read Source 1 demos header and for Source 2 demos the CDemoFileHeader proto message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitReader

type BitReader struct {
	bitread.BitReader
	// contains filtered or unexported fields
}

BitReader wraps github.com/markus-wa/gobitread.BitReader and provides additional functionality specific to CS:GO demos.

func NewLargeBitReader

func NewLargeBitReader(underlying io.Reader) *BitReader

NewLargeBitReader returns a BitReader with a large buffer, suitable for long streams (main demo file).

func NewSmallBitReader

func NewSmallBitReader(underlying io.Reader) *BitReader

NewSmallBitReader returns a BitReader with a small buffer, suitable for short streams.

func (*BitReader) Pool

func (r *BitReader) Pool() error

Pool puts the BitReader into a pool for future use. Pooling BitReaders improves performance by minimizing the amount newly allocated readers.

func (*BitReader) ReadFloat

func (r *BitReader) ReadFloat() float32

ReadFloat reads a 32-bit float. Wraps ReadInt().

func (*BitReader) ReadSignedVarInt32

func (r *BitReader) ReadSignedVarInt32() int32

ReadSignedVarInt32 reads a variable size signed int (max 32-bit).

func (*BitReader) ReadSignedVarInt64

func (r *BitReader) ReadSignedVarInt64() int64

ReadSignedVarInt64 reads a variable size signed int (max 64-bit).

func (*BitReader) ReadString

func (r *BitReader) ReadString() string

ReadString reads a variable length string.

func (*BitReader) ReadUBitInt

func (r *BitReader) ReadUBitInt() uint

ReadUBitInt reads some kind of variable size uint. Honestly, not quite sure how it works.

func (*BitReader) ReadVarInt32

func (r *BitReader) ReadVarInt32() uint32

ReadVarInt32 reads a variable size unsigned int (max 32-bit).

func (*BitReader) ReadVarInt64

func (r *BitReader) ReadVarInt64() uint64

ReadVarInt64 reads a variable size unsigned int (max 64-bit).

Jump to

Keyboard shortcuts

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