mirror of
https://github.com/valyala/bytebufferpool.git
synced 2026-06-14 13:26:35 +03:00
Add Bytes function (#3)
This commit is contained in:
committed by
Aliaksandr Valialkin
parent
21e406c403
commit
c57419c995
@@ -14,6 +14,9 @@ type ByteBuffer struct {
|
||||
B []byte
|
||||
}
|
||||
|
||||
// Bytes returns all bytes contained in buffer
|
||||
func (b *ByteBuffer) Bytes() []byte { return b.B }
|
||||
|
||||
// Write implements io.Writer - it appends p to ByteBuffer.B
|
||||
func (b *ByteBuffer) Write(p []byte) (int, error) {
|
||||
b.B = append(b.B, p...)
|
||||
|
||||
Reference in New Issue
Block a user