bytemap

package
v1.2.7-sp3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MAXLEN = 1 << 20

MAXLEN 1MB

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteMap

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

func NewByteMap

func NewByteMap(Len int) *ByteMap

func (*ByteMap) Bytes

func (m *ByteMap) Bytes() []byte

func (*ByteMap) Fill

func (m *ByteMap) Fill(offset int, content []byte)

Fill without check if filled if content is too large ByteMap will be resized to fit in

func (*ByteMap) FillLeftWithNoise

func (m *ByteMap) FillLeftWithNoise(noise func() byte)

FillLeftWithNoise fill the left empty space with noise

func (*ByteMap) FindFree

func (m *ByteMap) FindFree(Len int) int

FindFree find the first free space with Len

func (*ByteMap) FindFreeAfter

func (m *ByteMap) FindFreeAfter(Len int, offset int) int

FindFreeAfter find the first free space with Len after offset

func (*ByteMap) FindFreeRange

func (m *ByteMap) FindFreeRange(Len, begin, end int) []int

FindFreeRange find all free spaces with Len in range [begin,end)

func (*ByteMap) Last

func (m *ByteMap) Last() (int, int)

Last is lastpos and lastLen

func (*ByteMap) Resize

func (m *ByteMap) Resize(size int)

Resize resize the bytemap to size the original data will be copied

func (*ByteMap) Size

func (m *ByteMap) Size() int

func (*ByteMap) Test

func (m *ByteMap) Test(offset int) bool

func (*ByteMap) Trim

func (m *ByteMap) Trim(trimleft bool, trimright bool, targetLen int)

Jump to

Keyboard shortcuts

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