Documentation
¶
Overview ¶
Package bytes provides utilities that extend the Go standard library's bytes package
Index ¶
- Variables
- func ContainsAny(b []byte, chars []byte) bool
- func FromFloat32(v float32, order binary.ByteOrder) []byte
- func FromFloat64(v float64, order binary.ByteOrder) []byte
- func FromUint16(v uint16, order binary.ByteOrder) []byte
- func FromUint32(v uint32, order binary.ByteOrder) []byte
- func FromUint64(v uint64, order binary.ByteOrder) []byte
- func IsASCII(b []byte) bool
- func RemoveAll(s, chars []byte) []byte
- func Repeat(b []byte, n int) []byte
- func Reverse(b []byte) []byte
- func ReverseInPlace(b []byte)
- func SafeSlice(b []byte, start, length int) []byte
- func ToFloat32(b []byte, order binary.ByteOrder) (float32, error)
- func ToFloat64(b []byte, order binary.ByteOrder) (float64, error)
- func ToUint16(b []byte, order binary.ByteOrder) (uint16, error)
- func ToUint32(b []byte, order binary.ByteOrder) (uint32, error)
- func ToUint64(b []byte, order binary.ByteOrder) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInsufficientBytes = errors.New("insufficient bytes for conversion")
ErrInsufficientBytes is returned when a byte slice doesn't have enough bytes for conversion
Functions ¶
func ContainsAny ¶
ContainsAny returns true if the byte slice contains any of the bytes in chars
func FromFloat32 ¶
FromFloat32 converts float32 to a byte slice using the specified byte order
func FromFloat64 ¶
FromFloat64 converts float64 to a byte slice using the specified byte order
func FromUint16 ¶
FromUint16 converts uint16 to a byte slice using the specified byte order
func FromUint32 ¶
FromUint32 converts uint32 to a byte slice using the specified byte order
func FromUint64 ¶
FromUint64 converts uint64 to a byte slice using the specified byte order
func SafeSlice ¶
SafeSlice returns a slice of the specified length from the input bytes, or a smaller slice if the input is not long enough
Types ¶
This section is empty.