MCPcopy
hub / github.com/pquerna/ffjson / Buffer

Struct Buffer

fflib/v1/buffer.go:77–83  ·  view source on GitHub ↗

A Buffer is a variable-sized buffer of bytes with Read and Write methods. The zero value for Buffer is an empty buffer ready to use.

Source from the content-addressed store, hash-verified

75// A Buffer is a variable-sized buffer of bytes with Read and Write methods.
76// The zero value for Buffer is an empty buffer ready to use.
77type Buffer struct {
78 buf []byte // contents are the bytes buf[off : len(buf)]
79 off int // read at &buf[off], write at &buf[len(buf)]
80 runeBytes [utf8.UTFMax]byte // avoid allocation of slice on each WriteByte or Rune
81 encoder *json.Encoder
82 skipTrailingByte bool
83}
84
85// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer.
86var ErrTooLarge = errors.New("fflib.v1.Buffer: too large")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected