buffer

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

func FromByteArray added in v0.1.13

func FromByteArray(b []byte) *Buffer

FromByteArray creates a new buffer from a byte array

func NewBuffer

func NewBuffer(length int, init byte) *Buffer

NewBuffer creates a new buffer object of the specified length

func (*Buffer) Bytes added in v0.1.14

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

Bytes writes binary data to the stdout

func (*Buffer) CopyTo

func (buffer *Buffer) CopyTo(source []byte, destOffset int)

CopyTo copies as much of source as possible onto destination at the specified offset

func (*Buffer) HexString added in v0.1.14

func (buffer *Buffer) HexString() string

HexString writes data in hex string format to the stdout

func (*Buffer) Paint

func (buffer *Buffer) Paint(start int, length int, char byte)

Paint will paint a character on the buffer from start position for length characters

func (*Buffer) RevCopyTo

func (buffer *Buffer) RevCopyTo(source []byte, destOffset int)

RevCopyTo copies as much of source as possible onto destination at the specified offset in reverse order

func (*Buffer) Stdout

func (buffer *Buffer) Stdout(hex bool)

Write sends either bin or hex string data to the stdout

func (*Buffer) String

func (buffer *Buffer) String() string

String returns a string representation of the buffer

func (*Buffer) Stripe

func (buffer *Buffer) Stripe(start int, length int, stripeLength int)

Stripe will draw a stripe pattern in the target buffer of a length of length bytes starting from start. The stripe length will be stripeLength which is half the diversity of the stripe. If the stripe length is 4 it will look like 0000111100001111

func (*Buffer) SubStr

func (buffer *Buffer) SubStr(offset int, length int) string

SubStr returns a sub string within the buffer

func (*Buffer) Validate

func (buffer *Buffer) Validate() error

Validate returns an error if null bytes are present in the buffer

func (*Buffer) WriteByteAt

func (buffer *Buffer) WriteByteAt(offset int, char byte)

WriteByteAt writes a byte at the specified position

Jump to

Keyboard shortcuts

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