MCPcopy Create free account
hub / github.com/WICG/webpackage / Read

Method Read

go/signedexchange/mice/mice.go:200–213  ·  view source on GitHub ↗
(dst []byte)

Source from the content-addressed store, hash-verified

198}
199
200func (d *decoder) Read(dst []byte) (int, error) {
201 if len(d.out) == 0 {
202 if d.nextProof == nil {
203 // Already processed all records.
204 return 0, io.EOF
205 }
206 if err := d.readNextRecord(); err != nil {
207 return 0, err
208 }
209 }
210 n := copy(dst, d.out)
211 d.out = d.out[n:]
212 return n, nil
213}
214
215func (d *decoder) readNextRecord() error {
216 readBytes, err := io.ReadFull(d.r, d.recordBuf)

Callers 4

ReadFromMethod · 0.80
ReadExchangePrologueFunction · 0.80
NewDecoderMethod · 0.80
prettyPrintSCTFunction · 0.80

Calls 1

readNextRecordMethod · 0.95

Tested by

no test coverage detected