]> Cypherpunks repositories - gostls13.git/commitdiff
add a standard interface that wraps ReadByte, io.ReadByter
authorRob Pike <r@golang.org>
Thu, 7 Jan 2010 02:29:43 +0000 (13:29 +1100)
committerRob Pike <r@golang.org>
Thu, 7 Jan 2010 02:29:43 +0000 (13:29 +1100)
R=rsc
CC=golang-dev
https://golang.org/cl/181163

src/pkg/io/io.go

index 5d18476f5301aab29618faee730a7749b5fdc1c6..4357d5c6fbe548bbbae4d887c7107c0f9d2c1aa0 100644 (file)
@@ -150,6 +150,14 @@ type WriterAt interface {
        WriteAt(p []byte, off int64) (n int, err os.Error)
 }
 
+// ReadByter is the interface that wraps the ReadByte method.
+//
+// ReadByte reads and returns the next byte from the input.
+// If no byte is available, err will be set.
+type ReadByter interface {
+       ReadByte() (c byte, err os.Error)
+}
+
 // WriteString writes the contents of the string s to w, which accepts an array of bytes.
 func WriteString(w Writer, s string) (n int, err os.Error) {
        return w.Write(strings.Bytes(s))