mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
ByteBuffer.WriteByte
R=r DELTA=17 (10 added, 0 deleted, 7 changed) OCL=28860 CL=28862
This commit is contained in:
parent
8203a4cb9d
commit
472e191a23
2 changed files with 19 additions and 9 deletions
|
|
@ -74,6 +74,13 @@ func (b *ByteBuffer) Write(p []byte) (n int, err os.Error) {
|
|||
return n, nil
|
||||
}
|
||||
|
||||
// WriteByte appends the byte c to the buffer.
|
||||
// Because Write never fails and WriteByte is not part of the
|
||||
// io.Writer interface, it does not need to return a value.
|
||||
func (b *ByteBuffer) WriteByte(c byte) {
|
||||
b.Write([]byte{c});
|
||||
}
|
||||
|
||||
// Read reads the next len(p) bytes from the buffer or until the buffer
|
||||
// is drained. The return value n is the number of bytes read; err is always nil.
|
||||
func (b *ByteBuffer) Read(p []byte) (n int, err os.Error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue