Home | History | Annotate | Download | only in rand

Lines Matching defs:Read

53 	// generation during most recent Read call.
54 // It is saved so next Read call can start where the previous
254 // Read generates len(p) random bytes and writes them into p. It
256 // Read should not be called concurrently with any other Rand method.
257 func (r *Rand) Read(p []byte) (n int, err error) {
259 return lk.read(p, &r.readVal, &r.readPos)
261 return read(p, r.Int63, &r.readVal, &r.readPos)
264 func read(p []byte, int63 func() int64, readVal *int64, readPos *int8) (n int, err error) {
345 // Read generates len(p) random bytes from the default Source and
347 // Read, unlike the Rand.Read method, is safe for concurrent use.
348 func Read(p []byte) (n int, err error) { return globalRand.Read(p) }
404 // read implements Read for a lockedSource without a race condition.
405 func (r *lockedSource) read(p []byte, readVal *int64, readPos *int8) (n int, err error) {
407 n, err = read(p, r.src.Int63, readVal, readPos)