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

Function rwBytes

msgp/json.go:421–448  ·  view source on GitHub ↗
(dst jsWriter, src *Reader)

Source from the content-addressed store, hash-verified

419}
420
421func rwBytes(dst jsWriter, src *Reader) (n int, err error) {
422 var nn int
423 err = dst.WriteByte('"')
424 if err != nil {
425 return
426 }
427 n++
428 src.scratch, err = src.ReadBytes(src.scratch[:0])
429 if err != nil {
430 return
431 }
432 enc := base64.NewEncoder(base64.StdEncoding, dst)
433 nn, err = enc.Write(src.scratch)
434 n += nn
435 if err != nil {
436 return
437 }
438 err = enc.Close()
439 if err != nil {
440 return
441 }
442 err = dst.WriteByte('"')
443 if err != nil {
444 return
445 }
446 n++
447 return
448}
449
450// Below (c) The Go Authors, 2009-2014
451// Subject to the BSD-style license found at http://golang.org

Callers

nothing calls this directly

Calls 3

WriteByteMethod · 0.80
ReadBytesMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…