internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bb2bs

func Bb2bs(b *bytes.Buffer) []byte

Bb2bs extracts the backing slice from a bytes.Buffer. The bytes.Buffer can not be used and must be discarded when this function returns.

func Br2bs

func Br2bs(r *bufio.Reader) []byte

Br2bs extracts the backing slice from a bufio.Reader The bufio.Reader can not be used and must be discarded when this function returns.

func Bw2bs

func Bw2bs(w *bufio.Writer) []byte

Bw2bs extracts the backing slice from a bufio.Writer The bufio.Writer can not be used and must be discarded when this function returns.

func Gets

func Gets(b []byte) *[]byte

Gets stores the slice b into a slice struct allocated on the heap.

func Puts

func Puts(p *[]byte) []byte

Puts returns a copy of the slice pointed to by p and recycles the heap-allocated slice structure. Only the slice is copied, not the backing array.

Types

type BufferPool

type BufferPool struct {
	httputil.BufferPool                     // implements
	P                   httputil.BufferPool // actual underlying buffer pool
	Sz                  int
}

func (BufferPool) Get

func (b BufferPool) Get() []byte

func (BufferPool) Put

func (b BufferPool) Put(p []byte)

type SingleSizeBufferPool

type SingleSizeBufferPool struct {
	httputil.BufferPool // implements

	Sz int
	// contains filtered or unexported fields
}

func (*SingleSizeBufferPool) Get

func (b *SingleSizeBufferPool) Get() []byte

func (*SingleSizeBufferPool) Put

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

Jump to

Keyboard shortcuts

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