Commit 622d729b authored by Rob Pike's avatar Rob Pike

io: add ReadRuner

Put it in the same package as ReadByter.
There is no implementation here for either interface.

R=rsc
CC=golang-dev
https://golang.org/cl/4121051
parent 8a2d7064
......@@ -158,6 +158,15 @@ type ReadByter interface {
ReadByte() (c byte, err os.Error)
}
// ReadRuner is the interface that wraps the ReadRune method.
//
// ReadRune reads a single UTF-8 encoded Unicode character
// and returns the rune and its size in bytes. If no character is
// available, err will be set.
type ReadRuner interface {
ReadRune() (rune int, size int, 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([]byte(s))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment