Help us shape the future of Go! Take the 2026 Go Developer Survey

buffer

package
v0.12.13 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(data []byte) io.ReadCloser

NewReader creates a new reader closer wrapper

func Read

func Read(pool httputil.BufferPool, reader io.Reader) ([]byte, int, error)

Read reads data with buffer Pool

Types

type Pool

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

Pool represents data pool

func New

func New(poolMaxSize, bufferSize int) *Pool

New creates a httputil.BufferPool Pool.

func (*Pool) Get

func (p *Pool) Get() (result []byte)

Get returns bytes

func (*Pool) Put

func (p *Pool) Put(b []byte)

Put put data back to the pool

type Reader

type Reader struct {
	Data []byte
	io.Reader
}

Reader represents a reader

func (*Reader) Close

func (r *Reader) Close() error

Close closes reader

Jump to

Keyboard shortcuts

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