Add Bytes function (#3)

This commit is contained in:
Albert
2016-06-27 18:00:15 +05:00
committed by Aliaksandr Valialkin
parent 21e406c403
commit c57419c995
+3
View File
@@ -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...)