package buffer
Import Path
github.com/mailru/easyjson/buffer (on go.dev)
Dependency Relation
imports 3 packages, and imported by one package
Involved Source Files
Package buffer implements a buffer for serialization, consisting of a chain of []byte-s to
reduce copying and to allow reuse of individual chunks.
Package-Level Type Names (total 2)
Buffer is a buffer optimized for serialization without extra copying.
Buf is the current chunk that can be used for serialization.
AppendByte appends a single byte to buffer.
AppendBytes appends a byte slice to buffer.
AppendString appends a string to buffer.
BuildBytes creates a single byte slice with all the contents of the buffer. Data is
copied if it does not fit in a single chunk. You can optionally provide one byte
slice as argument that it will try to reuse.
DumpTo outputs the contents of a buffer to a writer and resets the buffer.
EnsureSpace makes sure that the current chunk contains at least s free bytes,
possibly creating a new chunk.
ReadCloser creates an io.ReadCloser with all the contents of the buffer.
Size computes the size of a buffer by adding sizes of every chunk.
*Buffer : github.com/gogo/protobuf/proto.Sizer
PoolConfig contains configuration for the allocation and reuse strategy.
// Maximum chunk size that will be allocated.
// Minimum chunk size that is reused, reusing chunks too small will result in overhead.
// Minimum chunk size that is allocated.
func Init(cfg PoolConfig)
Package-Level Functions (only one)
Init sets up a non-default pooling and allocation strategy. Should be run before serialization is done.
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |