bytes

package
v0.0.0-...-9b43e00 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 1 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
}

Buffer buffer.

func (*Buffer) Bytes

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

Bytes bytes.

type Pool

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

Pool is a buffer pool.

func NewPool

func NewPool(num, size int) (p *Pool)

NewPool new a memory buffer pool struct.

func (*Pool) Get

func (p *Pool) Get() (b *Buffer)

Get get a free memory buffer.

func (*Pool) Init

func (p *Pool) Init(num, size int)

Init init the memory buffer.

func (*Pool) Put

func (p *Pool) Put(b *Buffer)

Put put back a memory buffer to free.

type Writer

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

Writer writer.

func NewWriterSize

func NewWriterSize(n int) *Writer

NewWriterSize new a writer with size.

func (*Writer) Buffer

func (w *Writer) Buffer() []byte

Buffer return buff.

func (*Writer) Len

func (w *Writer) Len() int

Len buff len.

func (*Writer) Peek

func (w *Writer) Peek(n int) []byte

Peek peek a buf.

func (*Writer) Reset

func (w *Writer) Reset()

Reset reset the buff.

func (*Writer) Size

func (w *Writer) Size() int

Size buff cap.

func (*Writer) Write

func (w *Writer) Write(p []byte)

Write write a buff.

Jump to

Keyboard shortcuts

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