buffer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 2 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plotter

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

Plotter is a wrapper over a byte slice that enables writing of various types of primitives.

func NewPlotter

func NewPlotter(data []byte, order binary.ByteOrder) *Plotter

NewPlotter creates a new Plotter instance over the specified byte slice that will do writing using the specified byte order.

func (*Plotter) Data

func (p *Plotter) Data() []byte

Data returns the underlying byte slice.

func (*Plotter) Offset

func (p *Plotter) Offset() int

Offset returns the location of the write head.

func (*Plotter) PlotByte

func (p *Plotter) PlotByte(value byte)

PlotByte sets a single byte at the current offset and advances the offset with one byte.

func (*Plotter) PlotFloat32

func (p *Plotter) PlotFloat32(value float32)

PlotFloat32 sets a single float32 value at the current offset and advances the offset with four bytes.

func (*Plotter) PlotUint16

func (p *Plotter) PlotUint16(value uint16)

PlotUint16 sets a single uint16 value at the current offset and advances the offset with two bytes.

func (*Plotter) PlotUint32

func (p *Plotter) PlotUint32(value uint32)

PlotUint32 sets a single uint32 value at the current offset and advances the offset with four bytes.

func (*Plotter) Rewind

func (p *Plotter) Rewind()

Rewind moves the write head back to the start of the slice.

func (*Plotter) Seek

func (p *Plotter) Seek(offset int)

Seek changes the location of the write head.

Jump to

Keyboard shortcuts

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