Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Buffer.WriteByte and WriteString methods (#691)
These methods are equivalent to `AppendByte` and `AppendString`, but their signatures are compatible with [bytes.Buffer](https://godoc.org/bytes#Buffer) and [bufio.Writer](https://godoc.org/bufio#Writer). This allows to use `Buffer` where `bytes.Buffer` was expected without extra cost of wrapping. One example is msgpack library which expects `Writer` to implement `WriteByte` and `WriteString`, otherwise it is wrapped which incurs extra allocation: https://github.com/vmihailenco/msgpack/blob/master/encode.go#L63-L67
- Loading branch information