MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / Next

Method Next

internal/byte_input.go:71–82  ·  view source on GitHub ↗

Next returns a slice containing the next n bytes from the reader If there are fewer bytes than the given n, io.ErrUnexpectedEOF will be returned

(n int)

Source from the content-addressed store, hash-verified

69// Next returns a slice containing the next n bytes from the reader
70// If there are fewer bytes than the given n, io.ErrUnexpectedEOF will be returned
71func (b *ByteBuffer) Next(n int) ([]byte, error) {
72 m := len(b.buf) - b.off
73
74 if n > m {
75 return nil, io.ErrUnexpectedEOF
76 }
77
78 data := b.buf[b.off : b.off+n]
79 b.off += n
80
81 return data, nil
82}
83
84// NextReturnsSafeSlice returns false since ByteBuffer might hold
85// an array owned by some other systems.

Callers 2

ReadMethod · 0.95
FromUnsafeBytesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected