recordio

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFrameTooLarge = fmt.Errorf("frame: frame size exceeds maximum")

ErrFrameTooLarge is an error that is returned if a frame that is larger than the maximum allowed size (not including the frame header) is read.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	// ReadFrame reads the next frame, returning the frame's size and an io.Reader
	// for that frame's data. The io.Reader is restricted such that it cannot read
	// past the frame.
	//
	// The frame must be fully read before another Reader call can be made.
	// Failure to do so will cause the Reader to become unsynchronized.
	ReadFrame() (int64, io.Reader, error)

	// ReadFrame returns the contents of the next frame. If there are no more
	// frames available, ReadFrame will return io.EOF.
	ReadFrameAll() ([]byte, error)
}

Reader reads individual frames from a frame-formatted input Reader.

func NewReader

func NewReader(r io.Reader, maxSize int) Reader

NewReader creates a new Reader which reads frame data from the supplied Reader instance.

If the Reader instance is also an io.ByteReader, its ReadByte method will be used directly.

Jump to

Keyboard shortcuts

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