Commit 55b70d6c authored by Russ Cox's avatar Russ Cox

Return error from WriteByte, to match bufio.Writer.

R=gri
DELTA=4  (1 added, 0 deleted, 3 changed)
OCL=28868
CL=28899
parent 0fe8487c
...@@ -75,10 +75,11 @@ func (b *ByteBuffer) Write(p []byte) (n int, err os.Error) { ...@@ -75,10 +75,11 @@ func (b *ByteBuffer) Write(p []byte) (n int, err os.Error) {
} }
// WriteByte appends the byte c to the buffer. // WriteByte appends the byte c to the buffer.
// Because Write never fails and WriteByte is not part of the // The returned error is always nil, but is included
// io.Writer interface, it does not need to return a value. // to match bufio.Writer's WriteByte.
func (b *ByteBuffer) WriteByte(c byte) { func (b *ByteBuffer) WriteByte(c byte) os.Error {
b.Write([]byte{c}); b.Write([]byte{c});
return nil;
} }
// Read reads the next len(p) bytes from the buffer or until the buffer // Read reads the next len(p) bytes from the buffer or until the buffer
......
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