From c57419c995c02e36dae903b472591a36fb1647a0 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 27 Jun 2016 18:00:15 +0500 Subject: [PATCH] Add Bytes function (#3) --- bytebuffer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bytebuffer.go b/bytebuffer.go index 967cb76..aed9fb1 100644 --- a/bytebuffer.go +++ b/bytebuffer.go @@ -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...)