...

Package buffer

import "log/slog/internal/buffer"
Overview
Index

Overview ▾

Package buffer provides a pool-allocated byte buffer.

type Buffer

Buffer is a byte buffer.

This implementation is adapted from the unexported type buffer in go/src/fmt/print.go.

type Buffer []byte

func New

func New() *Buffer

func (*Buffer) Free

func (b *Buffer) Free()

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) SetLen

func (b *Buffer) SetLen(n int)

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) Write

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

func (*Buffer) WriteByte

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

func (*Buffer) WriteString

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