bytes

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bytes implements performant bytes implementations.

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 wraps a byte slice, providing continence functions.

func NewBuffer

func NewBuffer(size int) *Buffer

NewBuffer returns a buffer.

func (*Buffer) AppendBool

func (b *Buffer) AppendBool(v bool)

AppendBool appends a bool to the underlying Buffer.

func (*Buffer) AppendFloat

func (b *Buffer) AppendFloat(f float64, fmt byte, prec, bitSize int)

AppendFloat appends a float to the underlying Buffer.

func (*Buffer) AppendInt

func (b *Buffer) AppendInt(i int64)

AppendInt appends an integer to the underlying Buffer.

func (*Buffer) AppendUint

func (b *Buffer) AppendUint(i uint64)

AppendUint appends an unsigned integer to the underlying Buffer.

func (*Buffer) Bytes

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

Bytes returns a mutable reference to the underlying byte slice.

func (*Buffer) Len

func (b *Buffer) Len() int

Len returns the length of the buffer.

func (*Buffer) Reset

func (b *Buffer) Reset()

Reset resets the underlying byte slice. Subsequent writes re-use the slice's backing array.

func (*Buffer) Write

func (b *Buffer) Write(bs []byte)

Write implements io.Writer.

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(v byte)

WriteByte writes a single byte to the Buffer.

func (*Buffer) WriteRune

func (b *Buffer) WriteRune(r rune)

WriteRune writes a rune to the Buffer.

func (*Buffer) WriteString

func (b *Buffer) WriteString(s string)

WriteString writes a string to the Buffer.

Jump to

Keyboard shortcuts

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