Commit 827e98d4 authored by Robert Griesemer's avatar Robert Griesemer

io: rename interfaces

ReadByter -> ByteReader
ReadRuner -> RuneReader

R=r, r2, rsc
CC=golang-dev
https://golang.org/cl/4023062
parent fdb46fb4
...@@ -150,20 +150,20 @@ type WriterAt interface { ...@@ -150,20 +150,20 @@ type WriterAt interface {
WriteAt(p []byte, off int64) (n int, err os.Error) WriteAt(p []byte, off int64) (n int, err os.Error)
} }
// ReadByter is the interface that wraps the ReadByte method. // ByteReader is the interface that wraps the ReadByte method.
// //
// ReadByte reads and returns the next byte from the input. // ReadByte reads and returns the next byte from the input.
// If no byte is available, err will be set. // If no byte is available, err will be set.
type ReadByter interface { type ByteReader interface {
ReadByte() (c byte, err os.Error) ReadByte() (c byte, err os.Error)
} }
// ReadRuner is the interface that wraps the ReadRune method. // RuneReader is the interface that wraps the ReadRune method.
// //
// ReadRune reads a single UTF-8 encoded Unicode character // ReadRune reads a single UTF-8 encoded Unicode character
// and returns the rune and its size in bytes. If no character is // and returns the rune and its size in bytes. If no character is
// available, err will be set. // available, err will be set.
type ReadRuner interface { type RuneReader interface {
ReadRune() (rune int, size int, err os.Error) ReadRune() (rune int, size int, err os.Error)
} }
......
...@@ -163,7 +163,7 @@ type Parser struct { ...@@ -163,7 +163,7 @@ type Parser struct {
// "quot": `"`, // "quot": `"`,
Entity map[string]string Entity map[string]string
r io.ReadByter r io.ByteReader
buf bytes.Buffer buf bytes.Buffer
saved *bytes.Buffer saved *bytes.Buffer
stk *stack stk *stack
...@@ -191,7 +191,7 @@ func NewParser(r io.Reader) *Parser { ...@@ -191,7 +191,7 @@ func NewParser(r io.Reader) *Parser {
// Assume that if reader has its own // Assume that if reader has its own
// ReadByte, it's efficient enough. // ReadByte, it's efficient enough.
// Otherwise, use bufio. // Otherwise, use bufio.
if rb, ok := r.(io.ReadByter); ok { if rb, ok := r.(io.ByteReader); ok {
p.r = rb p.r = rb
} else { } else {
p.r = bufio.NewReader(r) p.r = bufio.NewReader(r)
......
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