Package buffers provides tools for working with byte array, and byte slice buffers, for the Go programming language.
Go to file
Charles Iliya Krempeaux a380cfb0e2 github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
LICENSE initial commit 2019-09-05 18:28:37 -07:00
README.md initial commit 2019-09-05 18:28:37 -07:00
buffer.go github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
doc.go docs 2019-09-05 18:31:11 -07:00
errors.go github.com/reiver/go-fck -> sourcecode.social/reiver/go-erorr 2023-10-25 14:01:31 -07:00
example_writer_test.go exam[ple 2019-09-05 18:43:53 -07:00
go.mod github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
go.sum github.com/reiver/go-utf8 -> sourcecode.social/reiver/go-utf8 2023-10-25 14:05:07 -07:00
limitedbuffer_test.go initial commits 2022-11-15 21:55:12 -08:00
tooshort.go buffers.TooShort 2019-09-05 18:31:59 -07:00
writer.go made buffers.NewWriter() return a *buffers.Writer, rather than a buffers.Writer 2019-09-05 18:53:40 -07:00
writer_test.go made buffers.NewWriter() return a *buffers.Writer, rather than a buffers.Writer 2019-09-05 18:53:40 -07:00

README.md

go-buffers

Package buffers provides tools for working with byte array, and byte slice buffers.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-buffers

GoDoc

Example

import "github.com/reiver/go-buffers"

// ...

var buffer [1024]byte

var p []byte = buffer[:]

writer := buffers.NewWriter(p)

n, err := writer.Write(data)

switch casted := err.(type) {
case buffers.TooShort:
	//@TODO
default:
	return err
}