bytes

package
v0.0.0-...-168ccc2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package bytes implements functions for the manipulation of byte slices.

Index

Constants

This section is empty.

Variables

View Source
var ErrTooLarge = errors.New("bytes.Buffer: too large")

Functions

func Compare

func Compare(s1, s2 []byte) int

func Equal

func Equal(s1, s2 []byte) bool

func Fill

func Fill(s []byte, b byte)

Fill fills s with b.

func IndexByte

func IndexByte(s []byte, c byte) int

IndexByte returns the index of first c in s or -1 if there is no c in s.

func TrimSpace

func TrimSpace(s []byte) []byte

TrimSpace returns a slice of the s, with all leading and trailing white space removed. BUG: unicode whitespaces not supported.

Types

type Buffer

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

func MakeBuffer

func MakeBuffer(buf []byte, fixed bool) Buffer

func NewBuffer

func NewBuffer(buf []byte) *Buffer

func (*Buffer) Bytes

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

func (*Buffer) Cap

func (b *Buffer) Cap() int

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Read

func (b *Buffer) Read(s []byte) (n int, err error)

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) Truncate

func (b *Buffer) Truncate(n int)

func (*Buffer) Write

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

func (*Buffer) WriteString

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

Jump to

Keyboard shortcuts

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