MCPcopy Index your code
hub / github.com/Monibuca/engine / Write

Method Write

util/buffer.go:156–166  ·  view source on GitHub ↗
(a []byte)

Source from the content-addressed store, hash-verified

154 *b = append(*b, a...)
155}
156func (b *Buffer) Write(a []byte) (n int, err error) {
157 l := b.Len()
158 newL := l + len(a)
159 if newL > b.Cap() {
160 *b = append(*b, a...)
161 } else {
162 *b = b.SubBuf(0, newL)
163 copy((*b)[l:], a)
164 }
165 return len(a), nil
166}
167
168func (b Buffer) Clone() (result Buffer) {
169 return append(result, b...)

Callers 2

WriteSliceBytesMethod · 0.95
TestBufferFunction · 0.95

Calls 3

LenMethod · 0.95
CapMethod · 0.95
SubBufMethod · 0.95

Tested by 1

TestBufferFunction · 0.76