first commit

This commit is contained in:
2022-12-24 17:48:08 +02:00
commit 57c4f8e7b9
6 changed files with 2513 additions and 0 deletions

27
buffer_test.go Normal file
View File

@@ -0,0 +1,27 @@
package bin
import (
"fmt"
"testing"
)
func TestBuffer(t *testing.T) {
arr := make([]byte, 0)
buf := NewBuffer(arr)
buf.WriteByte(100)
fmt.Println(buf.ByteAt(0))
buf.Write([]byte{1, 2, 3})
buf.WriteByteAt(200, 0)
fmt.Println(buf.ByteAt(0))
fmt.Println(buf.Bytes())
buf.Reset()
fmt.Println(buf.Bytes())
fmt.Println(buf.Len())
}