bufiox

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSeekUnsupported = errors.New("bufio: the underlying reader doesn't support seek")

ErrSeekUnsupported error.

Functions

func Buffer

func Buffer(b *bufio.Reader) []byte

Buffer is reserved for internal use.

func IsReaderBuffer

func IsReaderBuffer(b *bufio.Reader) bool

IsReaderBuffer returns if this Reader instance is returned by NewReaderBuffer

func NewReaderBuffer

func NewReaderBuffer(buf []byte) *bufio.Reader

NewReaderBuffer returns a new Reader who uses a extern buffer.

func ReadAll

func ReadAll(b *bufio.Reader) (ret []byte, err error)

ReadAll reads all data

func Seek added in v1.8.2

func Seek(b *bufio.Reader, offset int64, whence int) (int64, error)

Seek sets the offset for the next Read or Write to offset, interpreted according to whence: SeekStart means relative to the start of the file, SeekCurrent means relative to the current offset, and SeekEnd means relative to the end. Seek returns the new offset relative to the start of the file and an error, if any.

Types

type Reader added in v1.8.2

type Reader struct {
	bufio.Reader
}

Reader class.

func NewReader added in v1.8.2

func NewReader(rd io.ReadSeeker) *Reader

NewReader returns a new Reader whose buffer has the default size.

func NewReaderSize added in v1.8.2

func NewReaderSize(rd io.ReadSeeker, size int) *Reader

NewReaderSize returns a new Reader whose buffer has at least the specified size. If the argument io.Reader is already a Reader with large enough size, it returns the underlying Reader.

func (*Reader) Seek added in v1.8.2

func (p *Reader) Seek(offset int64, whence int) (int64, error)

Seek sets the offset for the next Read or Write to offset, interpreted according to whence: SeekStart means relative to the start of the file, SeekCurrent means relative to the current offset, and SeekEnd means relative to the end. Seek returns the new offset relative to the start of the file and an error, if any.

Jump to

Keyboard shortcuts

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