MCPcopy Create free account
hub / github.com/Edgio/vflow / Read

Method Read

reader/reader.go:95–104  ·  view source on GitHub ↗

Read reads n bytes and returns it

(n int)

Source from the content-addressed store, hash-verified

93
94// Read reads n bytes and returns it
95func (r *Reader) Read(n int) ([]byte, error) {
96 if len(r.data) < n {
97 return []byte{}, errReader
98 }
99
100 d := r.data[:n]
101 r.advance(n)
102
103 return d, nil
104}
105
106// PeekUint16 peeks the next two bytes interpreted as big-endian two-byte integer
107func (r *Reader) PeekUint16() (res uint16, err error) {

Callers 10

TestReadNFunction · 0.95
TestReadCountFunction · 0.95
TestGetSampleInfoFunction · 0.95
decodeSetMethod · 0.80
decodeDataMethod · 0.80
decodeDataMethod · 0.80
decodeSetMethod · 0.80
sfHeaderDecodeMethod · 0.80
readFunction · 0.80
unmarshalMethod · 0.80

Calls 1

advanceMethod · 0.95

Tested by 3

TestReadNFunction · 0.76
TestReadCountFunction · 0.76
TestGetSampleInfoFunction · 0.76