package seekbuf
import "git.wntrmute.dev/kyle/goutils/seekbuf"
Package seekbuf implements a read-seekable buffer.
Index ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a ReadWriteCloser that supports seeking. It's intended to replicate the functionality of bytes.Buffer that I use in my projects.
Note that the seeking is limited to the read marker; all writes are append-only.
func New ¶
func (*Buffer) Bytes ¶
Bytes returns the underlying bytes from the current position.
func (*Buffer) Close ¶
Close clears all the data out of the buffer and sets the read position to 0.
func (*Buffer) Len ¶
Len returns the length of data remaining to be read.
func (*Buffer) Read ¶
func (*Buffer) Rewind ¶
func (b *Buffer) Rewind()
Rewind resets the read pointer to 0.
func (*Buffer) Seek ¶
Seek sets the read pointer to pos.
func (*Buffer) Write ¶
Source Files ¶
seekbuf.go
- Version
- v1.7.7 (latest)
- Published
- Jun 15, 2024
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 4 days ago –
Tools for package owners.