MCPcopy
hub / github.com/tinylib/msgp / NewWriterSize

Function NewWriterSize

msgp/write.go:130–139  ·  view source on GitHub ↗

NewWriterSize returns a writer with a custom buffer size.

(w io.Writer, sz int)

Source from the content-addressed store, hash-verified

128
129// NewWriterSize returns a writer with a custom buffer size.
130func NewWriterSize(w io.Writer, sz int) *Writer {
131 // we must be able to require() 'minWriterSize'
132 // contiguous bytes, so that is the
133 // practical minimum buffer size
134 if sz < minWriterSize {
135 sz = minWriterSize
136 }
137 buf := make([]byte, sz)
138 return NewWriterBuf(w, buf)
139}
140
141// NewWriterBuf returns a writer with a provided buffer.
142// 'buf' is not used when the capacity is smaller than 18,

Callers 1

mainFunction · 0.92

Calls 1

NewWriterBufFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…