Documentation ¶
Overview ¶
this is a pseudorandom reader that generates a deterministic sequence of bytes based on the seed. It is used in tests to enable large volumes of pseudorandom data to be generated and compared without having to store the data in memory.
Index ¶
- func NewSeed() ([]byte, error)
- type Reader
- func (r1 *Reader) Equal(r2 io.Reader) (bool, error)
- func (r1 *Reader) Match(r2 io.Reader, l int) (bool, error)
- func (r *Reader) Offset() int64
- func (r *Reader) Read(buf []byte) (n int, err error)
- func (r *Reader) ReadAt(buf []byte, off int64) (n int, err error)
- func (r *Reader) Seek(offset int64, whence int) (int64, error)
- func (r *Reader) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a pseudorandom reader that generates a deterministic sequence of bytes based on the seed.
func (*Reader) Equal ¶
Equal compares the contents of the reader with the contents of the given reader. It returns true if the contents are equal upto n bytes
func (*Reader) Match ¶
Match compares the contents of the reader with the contents of the given reader. It returns true if the contents are equal upto n bytes
func (*Reader) Read ¶
Read reads len(buf) bytes into buf. It returns the number of bytes read (0 <= n <= len(buf)) and any error encountered. Even if Read returns n < len(buf), it may use all of buf as scratch space during the call. If some data is available but not len(buf) bytes, Read conventionally returns what is available instead of waiting for more.