1
0
mirror of https://github.com/golang/go synced 2024-11-24 21:10:04 -07:00

io: clarify that ReadAt shouldn't move the seek offset

R=r, mkrautz, r2, rsc
CC=golang-dev
https://golang.org/cl/4415041
This commit is contained in:
Brad Fitzpatrick 2011-04-13 11:18:38 -07:00
parent a5ca635287
commit 0be2ef3fc4

View File

@ -136,6 +136,10 @@ type WriterTo interface {
// At the end of the input stream, ReadAt returns 0, os.EOF. // At the end of the input stream, ReadAt returns 0, os.EOF.
// ReadAt may return a non-zero number of bytes with a non-nil err. // ReadAt may return a non-zero number of bytes with a non-nil err.
// In particular, a ReadAt that exhausts the input may return n > 0, os.EOF. // In particular, a ReadAt that exhausts the input may return n > 0, os.EOF.
//
// If ReadAt is reading from an data stream with a seek offset,
// ReadAt should not affect nor be affected by the underlying
// seek offset.
type ReaderAt interface { type ReaderAt interface {
ReadAt(p []byte, off int64) (n int, err os.Error) ReadAt(p []byte, off int64) (n int, err os.Error)
} }