You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
“ReadAt reads len(p) bytes into p starting at offset off in the underlying input source. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
When ReadAt returns n < len(p), it returns a non-nil error explaining why more bytes were not returned. In this respect, ReadAt is stricter than Read.”
If you simply try playing with a file you'd quickly observe that this is not followed. Taking a real world example I have a file of size 280689401. I pass in p of length 227743. But only 214 bytes are read. And the err is nil.
The text was updated successfully, but these errors were encountered:
ashishgandhi
changed the title
io.ReaderAt has incorrect behavior
ReadAt does not have io.ReaderAt behavior
Nov 22, 2015
According to the
io.ReaderAt
documentation (https://golang.org/pkg/io/#ReaderAt). For the signature“ReadAt reads len(p) bytes into p starting at offset off in the underlying input source. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
When ReadAt returns n < len(p), it returns a non-nil error explaining why more bytes were not returned. In this respect, ReadAt is stricter than Read.”
If you simply try playing with a file you'd quickly observe that this is not followed. Taking a real world example I have a file of size 280689401. I pass in
p
of length 227743. But only 214 bytes are read. And theerr
isnil
.The text was updated successfully, but these errors were encountered: