Skip to content

Commit

Permalink
Add WriteByte function (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
n10v authored and valyala committed Jun 27, 2016
1 parent 928aed2 commit 21e406c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bytebuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ func (b *ByteBuffer) Write(p []byte) (int, error) {
return len(p), nil
}

// WriteByte appends the byte c to the buffer.
// The returned error is always nil.
func (b *ByteBuffer) WriteByte(c byte) error {
b.B = append(b.B, c)
return nil
}

// WriteString appends s to ByteBuffer.B
func (b *ByteBuffer) WriteString(s string) (int, error) {
b.B = append(b.B, s...)
Expand Down

0 comments on commit 21e406c

Please sign in to comment.