listbuffer

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteBuffer

type ByteBuffer struct {
	Buf *bbPool.ByteBuffer
	// contains filtered or unexported fields
}

ByteBuffer is the node of the linked list of bytes.

func (*ByteBuffer) IsEmpty

func (b *ByteBuffer) IsEmpty() bool

IsEmpty indicates whether the ByteBuffer is empty.

func (*ByteBuffer) Len

func (b *ByteBuffer) Len() int

Len returns the length of ByteBuffer.

type ListBuffer

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

ListBuffer is a linked list of ByteBuffer.

func (*ListBuffer) Bytes

func (l *ListBuffer) Bytes() int64

Bytes returns the amount of bytes in this list.

func (*ListBuffer) DiscardBytes

func (l *ListBuffer) DiscardBytes(n int)

DiscardBytes removes some nodes based on n.

func (*ListBuffer) IsEmpty

func (l *ListBuffer) IsEmpty() bool

IsEmpty reports whether l is empty.

func (*ListBuffer) Len

func (l *ListBuffer) Len() int

Len returns the length of the list.

func (*ListBuffer) PeekBytesList

func (l *ListBuffer) PeekBytesList(maxBytes int) [][]byte

PeekBytesList assembles the up to maxBytes of [][]byte based on the list of ByteBuffer, it won't remove these nodes from l until DiscardBytes() is called.

func (*ListBuffer) PeekBytesListWithBytes

func (l *ListBuffer) PeekBytesListWithBytes(maxBytes int, bs ...[]byte) [][]byte

PeekBytesListWithBytes is like PeekBytesList but accepts [][]byte and puts them onto head.

func (*ListBuffer) Pop

func (l *ListBuffer) Pop() *ByteBuffer

Pop returns and removes the head of l. If l is empty, it returns nil.

func (*ListBuffer) PushBack

func (l *ListBuffer) PushBack(b *ByteBuffer)

PushBack adds a new node to the tail of l.

func (*ListBuffer) PushBytesBack

func (l *ListBuffer) PushBytesBack(p []byte)

PushBytesBack is a wrapper of PushBack, which accepts []byte as its argument.

func (*ListBuffer) PushBytesFront

func (l *ListBuffer) PushBytesFront(p []byte)

PushBytesFront is a wrapper of PushFront, which accepts []byte as its argument.

func (*ListBuffer) PushFront

func (l *ListBuffer) PushFront(b *ByteBuffer)

PushFront adds the new node to the head of l.

func (*ListBuffer) Reset

func (l *ListBuffer) Reset()

Reset removes all elements from this list.

Jump to

Keyboard shortcuts

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