stream

package
v0.0.0-...-22a2ae8 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignExtend14Bit

func SignExtend14Bit(val uint16) int64

SignExtend14Bit signs

func SignExtend24Bit

func SignExtend24Bit(val uint32) int64

SignExtend24Bit signs

func SignExtend2Bit

func SignExtend2Bit(val uint8) int64

SignExtend2Bit signs

func SignExtend4Bit

func SignExtend4Bit(nibble uint8) int64

SignExtend4Bit signs

func SignExtend6Bit

func SignExtend6Bit(nibble uint8) int64

SignExtend6Bit signs

Types

type Decoder

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

Decoder can read various form of encoded bytes

func NewDecoder

func NewDecoder(reader io.Reader) *Decoder

NewDecoder returns a new instance of a Decoder

func (*Decoder) EOF

func (d *Decoder) EOF() (bool, error)

EOF returns true if the end of file was reached

func (*Decoder) NextByte

func (d *Decoder) NextByte() (byte, error)

NextByte returns the next byte without changing the file pointer

func (*Decoder) Offset

func (d *Decoder) Offset() int64

Offset returns the offset in the current file

func (*Decoder) ReadByte

func (d *Decoder) ReadByte() (byte, error)

ReadByte reads one byte

func (*Decoder) ReadBytes

func (d *Decoder) ReadBytes(number int) ([]byte, error)

ReadBytes reads multiple bytes

func (*Decoder) ReadInt

func (d *Decoder) ReadInt() (int64, error)

ReadInt reads one byte as integer

func (*Decoder) ReadSignedVB

func (d *Decoder) ReadSignedVB() (int32, error)

ReadSignedVB applies a pre-processing step to fold negative values into positive ones, then the resulting unsigned number is encoded using unsigned variable byte encoding.

func (*Decoder) ReadTag2_3S32

func (d *Decoder) ReadTag2_3S32() ([]int64, error)

ReadTag2_3S32 returns

func (*Decoder) ReadTag8_4S16V1

func (d *Decoder) ReadTag8_4S16V1() ([]int64, error)

ReadTag8_4S16V1 returns

func (*Decoder) ReadTag8_4S16V2

func (d *Decoder) ReadTag8_4S16V2() ([]int64, error)

ReadTag8_4S16V2 returns

func (*Decoder) ReadTag8_8SVB

func (d *Decoder) ReadTag8_8SVB(valueCount int) ([]int64, error)

ReadTag8_8SVB first an 8-bit (one byte) header is written. This header has its bits set to zero when the corresponding field (from a maximum of 8 fields) is set to zero, otherwise the bit is set to one. The least-signficant bit in the header corresponds to the first field to be written. This header is followed by the values of only the fields which are non-zero, written using signed variable byte encoding.

func (*Decoder) ReadUnsignedVB

func (d *Decoder) ReadUnsignedVB() (uint32, error)

ReadUnsignedVB reads the most straightforward encoding. This encoding uses the lower 7 bits of an encoded byte to store the lower 7 bits of the field's value. The high bit of that encoded byte is set to one if more than 7 bits are required to store the value. If the value did exceed 7 bits, the lower 7 bits of the value (which were written to the log) are removed from the value (by right shift), and the encoding process begins again with the new value.

type ReadError

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

func (ReadError) Error

func (e ReadError) Error() string

Jump to

Keyboard shortcuts

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