bytebufferpool

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The files in this package are copied from github.com/valyala/bytebufferpool. We keep the original MIT license and note the upstream source here.

Upstream source:

Repo: github.com/valyala/bytebufferpool
Files copied: doc.go, bytebuffer.go, pool.go
License: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Put

func Put(b *ByteBuffer)

Types

type ByteBuffer

type ByteBuffer struct {
	B []byte
}

ByteBuffer provides byte buffer, which can be used for minimizing memory allocations.

func Get

func Get() *ByteBuffer

func (*ByteBuffer) Bytes

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

func (*ByteBuffer) Len

func (b *ByteBuffer) Len() int

func (*ByteBuffer) ReadFrom

func (b *ByteBuffer) ReadFrom(r io.Reader) (int64, error)

func (*ByteBuffer) Reset

func (b *ByteBuffer) Reset()

func (*ByteBuffer) Set

func (b *ByteBuffer) Set(p []byte)

func (*ByteBuffer) SetString

func (b *ByteBuffer) SetString(s string)

func (*ByteBuffer) String

func (b *ByteBuffer) String() string

func (*ByteBuffer) Write

func (b *ByteBuffer) Write(p []byte) (int, error)

func (*ByteBuffer) WriteByte

func (b *ByteBuffer) WriteByte(c byte) error

func (*ByteBuffer) WriteString

func (b *ByteBuffer) WriteString(s string) (int, error)

func (*ByteBuffer) WriteTo

func (b *ByteBuffer) WriteTo(w io.Writer) (int64, error)

type Pool

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

func (*Pool) Get

func (p *Pool) Get() *ByteBuffer

func (*Pool) Put

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

Jump to

Keyboard shortcuts

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