bytes2

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 15

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 implements a subset of the write portion of bytes.Buffer, but more efficiently. This is meant to be used in very high QPS operations, especially for WriteByte, and without abstracting it as a Writer. Function signatures contain errors for compatibility, but they do not return errors.

func NewBuffer

func NewBuffer(b []byte) *Buffer

NewBuffer is equivalent to bytes.NewBuffer.

func (*Buffer) Bytes

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

Bytes is equivalent to bytes.Buffer.Bytes.

func (*Buffer) Len

func (buf *Buffer) Len() int

Len is equivalent to bytes.Buffer.Len.

func (*Buffer) Reset added in v0.11.0

func (buf *Buffer) Reset()

Reset is equivalent to bytes.Buffer.Reset.

func (*Buffer) String

func (buf *Buffer) String() string

Strings is equivalent to bytes.Buffer.Strings.

func (*Buffer) StringUnsafe added in v0.11.0

func (buf *Buffer) StringUnsafe() string

StringUnsafe is equivalent to String, but the copy of the string that it returns is _not_ allocated, so modifying this buffer after calling StringUnsafe will lead to undefined behavior.

func (*Buffer) Write

func (buf *Buffer) Write(b []byte) (int, error)

Write is equivalent to bytes.Buffer.Write.

func (*Buffer) WriteByte

func (buf *Buffer) WriteByte(b byte) error

WriteByte is equivalent to bytes.Buffer.WriteByte.

func (*Buffer) WriteString

func (buf *Buffer) WriteString(s string) (int, error)

WriteString is equivalent to bytes.Buffer.WriteString.

Jump to

Keyboard shortcuts

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