]> Cypherpunks repositories - gostls13.git/commitdiff
io: document ReaderFrom and WriterTo
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 7 Aug 2012 06:10:10 +0000 (16:10 +1000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 7 Aug 2012 06:10:10 +0000 (16:10 +1000)
Fixes #3711

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6445083

src/pkg/io/io.go

index 54bf159eb4112442607d021e514a0ed73b831950..7c863c16d32d93f571758888b06bf62e3ec4638f 100644 (file)
@@ -130,11 +130,23 @@ type ReadWriteSeeker interface {
 }
 
 // ReaderFrom is the interface that wraps the ReadFrom method.
+//
+// ReadFrom reads data from r until EOF. The return value n is the
+// number of bytes read. Any error except io.EOF encountered during
+// the read is also returned.
+//
+// The Copy function uses ReaderFrom if available.
 type ReaderFrom interface {
        ReadFrom(r Reader) (n int64, err error)
 }
 
 // WriterTo is the interface that wraps the WriteTo method.
+//
+// WriteTo writes data to w until there's no more data to write or
+// when an error occurs. The return value n is the number of bytes
+// written. Any error encountered during the write is also returned.
+//
+// The Copy function uses WriterTo if available.
 type WriterTo interface {
        WriteTo(w Writer) (n int64, err error)
 }