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

Function rwBytesBytes

msgp/json_bytes.go:186–208  ·  view source on GitHub ↗
(w jsWriter, msg []byte, scratch []byte, depth int)

Source from the content-addressed store, hash-verified

184}
185
186func rwBytesBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) {
187 bts, msg, err := ReadBytesZC(msg)
188 if err != nil {
189 return msg, scratch, err
190 }
191 l := base64.StdEncoding.EncodedLen(len(bts))
192 if cap(scratch) >= l {
193 scratch = scratch[0:l]
194 } else {
195 scratch = make([]byte, l)
196 }
197 base64.StdEncoding.Encode(scratch, bts)
198 err = w.WriteByte('"')
199 if err != nil {
200 return msg, scratch, err
201 }
202 _, err = w.Write(scratch)
203 if err != nil {
204 return msg, scratch, err
205 }
206 err = w.WriteByte('"')
207 return msg, scratch, err
208}
209
210func rwNullBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) {
211 msg, err := ReadNilBytes(msg)

Callers 1

rwMapKeyBytesFunction · 0.85

Calls 3

ReadBytesZCFunction · 0.85
WriteByteMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…