memory

package
v0.0.0-...-ace9e8d Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PieceBuffer

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

PieceBuffer a piece of continuous memory

func NewPieceBuffer

func NewPieceBuffer(capacity int) (pb *PieceBuffer)

NewPieceBuffer returns a new piece buffer

func (*PieceBuffer) Compact

func (pb *PieceBuffer) Compact()

Compact compact the buffer

func (*PieceBuffer) GetBuffer

func (pb *PieceBuffer) GetBuffer() []byte

GetBuffer get the buffer data

func (*PieceBuffer) GetCapacity

func (pb *PieceBuffer) GetCapacity() int

GetCapacity get the buffer capacity

func (*PieceBuffer) GetPullLength

func (pb *PieceBuffer) GetPullLength() int

GetPullLength get the buffer pull length

func (*PieceBuffer) GetPushLength

func (pb *PieceBuffer) GetPushLength() int

GetPushLength get the buffer push length

func (*PieceBuffer) Peek

func (pb *PieceBuffer) Peek(outBuffer []byte) int

Peek peek data in the buffer

func (*PieceBuffer) Pull

func (pb *PieceBuffer) Pull(outBuffer []byte) int

Pull pull data from the buffer

func (*PieceBuffer) Push

func (pb *PieceBuffer) Push(inData []byte) int

Push push data into the buffer

func (*PieceBuffer) Skip

func (pb *PieceBuffer) Skip(length int) int

Skip skip data of length in the buffer

type RingBuffer

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

RingBuffer a ring circular buffer

func NewRingBuffer

func NewRingBuffer(capacity int) (pb *RingBuffer)

NewRingBuffer returns a new ring buffer

func (*RingBuffer) GetCapacity

func (rb *RingBuffer) GetCapacity() int

GetCapacity get the buffer capacity

func (*RingBuffer) GetPullLength

func (rb *RingBuffer) GetPullLength() int

GetPullLength get the buffer pull length

func (*RingBuffer) GetPushLength

func (rb *RingBuffer) GetPushLength() int

GetPushLength get the buffer push length

func (*RingBuffer) IsEmpty

func (rb *RingBuffer) IsEmpty() bool

IsEmpty check if the buffer is empty

func (*RingBuffer) IsFull

func (rb *RingBuffer) IsFull() bool

IsFull check if the buffer is full

func (*RingBuffer) Peek

func (rb *RingBuffer) Peek(outBuffer []byte) int

Peek peek data in the buffer

func (*RingBuffer) Pull

func (rb *RingBuffer) Pull(outBuffer []byte) int

Pull pull data from the buffer

func (*RingBuffer) Push

func (rb *RingBuffer) Push(inData []byte) int

Push push data into the buffer

func (*RingBuffer) Skip

func (rb *RingBuffer) Skip(outLength int) int

Skip skip data of length in the buffer

Jump to

Keyboard shortcuts

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