Initial implementation

This commit is contained in:
Aliaksandr Valialkin
2016-06-22 19:36:29 +03:00
commit 21bf76e6cc
10 changed files with 324 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package bytebufferpool_test
import (
"fmt"
"github.com/valyala/bytebufferpool"
)
func ExampleByteBuffer() {
bb := bytebufferpool.AcquireByteBuffer()
bb.WriteString("first line\n")
bb.Write([]byte("second line\n"))
bb.B = append(bb.B, "third line\n"...)
fmt.Printf("bytebuffer contents=%q", bb.B)
// It is safe to release byte buffer now, since it is
// no longer used.
bytebufferpool.ReleaseByteBuffer(bb)
}