chunkbuf

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2018 License: AGPL-3.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkBuffer

type ChunkBuffer struct {
	// contains filtered or unexported fields
}

ChunkBuffer represents a custom buffer struct with Read/Write and Seek support.

func NewChunkBuffer

func NewChunkBuffer(data []byte) *ChunkBuffer

NewChunkBuffer returns a ChunkBuffer with the given data. if data is nil a ChunkBuffer with 64k is returned. Note that chunkbuf will take over ownership over the buf.

func (*ChunkBuffer) Close

func (c *ChunkBuffer) Close() error

Close is a no-op only existing to fulfill io.Closer

func (*ChunkBuffer) Len

func (c *ChunkBuffer) Len() int

Len tells you the current size of the buffer contents

func (*ChunkBuffer) Read

func (c *ChunkBuffer) Read(p []byte) (int, error)

func (*ChunkBuffer) Reset

func (c *ChunkBuffer) Reset()

Reset resets the buffer like bytes.Buffer

func (*ChunkBuffer) Seek

func (c *ChunkBuffer) Seek(offset int64, whence int) (int64, error)

Seek implements io.Seeker

func (*ChunkBuffer) Write

func (c *ChunkBuffer) Write(p []byte) (int, error)

func (*ChunkBuffer) WriteTo

func (c *ChunkBuffer) WriteTo(w io.Writer) (int64, error)

WriteTo implements the io.WriterTo interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL