bin

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bin provides some low level binary protocol helpers

Index

Constants

View Source
const (
	// Fixed16bitDiv is the 2^16 value used to convert fractional part to fraction
	Fixed16bitDiv = 65536.0
)

Variables

This section is empty.

Functions

func Equal

func Equal(a, b []byte) bool

Equal returns true if the given byte slices are equal in value byte for byte

func Fixed32BE

func Fixed32BE(data []byte) float64

Fixed32BE reads 4 bytes of data as BigEndian fixed point 16.16 and converts to float

func Int8BE

func Int8BE(data byte) int

Int8BE reads data as BigEndian

func Int16BE

func Int16BE(data []byte) int

Int16BE reads data as BigEndian

func Int32BE

func Int32BE(data []byte) int

Int32BE reads data as BigEndian

func Int64BE

func Int64BE(data []byte) int64

Int64BE reads data as BigEndian

func MediaDuration32BE

func MediaDuration32BE(data []byte, timeScale uint32) time.Duration

MediaDuration32BE reads 4 bytes of data as BigEndian and converts it to a duration taking into account the time scale. data is in media units

func MediaTime32BE

func MediaTime32BE(data []byte) time.Time

MediaTime32BE reads 4 bytes of data as BigEndian and convert to time

func PutUint32BE

func PutUint32BE(data []byte, val uint32)

PutUint32BE is just a wrapper around binary.BigEndian for convenience

func Uint16BE

func Uint16BE(data []byte) uint16

Uint16BE reads data as BigEndian

func Uint32BE

func Uint32BE(data []byte) uint32

Uint32BE reads data as BigEndian

func Uint64BE

func Uint64BE(data []byte) uint64

Uint64BE reads data as BigEndian

Types

This section is empty.

Jump to

Keyboard shortcuts

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