MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / readN

Method readN

decode.go:627–642  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

625}
626
627func (d *Decoder) readN(n int) ([]byte, error) {
628 var err error
629 if d.flags&disableAllocLimitFlag != 0 {
630 d.buf, err = readN(d.r, d.buf, n)
631 } else {
632 d.buf, err = readNGrow(d.r, d.buf, n)
633 }
634 if err != nil {
635 return nil, err
636 }
637 if d.rec != nil {
638 // TODO: read directly into d.rec?
639 d.rec = append(d.rec, d.buf...)
640 }
641 return d.buf, nil
642}
643
644func readN(r io.Reader, b []byte, n int) ([]byte, error) {
645 if b == nil {

Callers 8

skipNMethod · 0.95
uint16Method · 0.95
uint32Method · 0.95
uint64Method · 0.95
stringWithLenMethod · 0.95
decodeStringTempMethod · 0.95
decodeTimeMethod · 0.95
RegisterExtFunction · 0.80

Calls 2

readNFunction · 0.85
readNGrowFunction · 0.85

Tested by

no test coverage detected