package recordio

import "github.com/mesos/mesos-go/api/v1/lib/recordio"

Package recordio implements the Mesos variant of RecordIO framing, whereby each record is prefixed by a line that indicates the length of the record in decimal ASCII. The bytes of the record immediately follow the length-line. Zero-length records are allowed.

Example

Code:

{
	r := NewReader(strings.NewReader("6\nhello 0\n6\nworld!"))
	records, err := ioutil.ReadAll(r)
	fmt.Println(string(records), err)
	// Output:
	// hello world! <nil>
}

Output:

hello world! <nil>

Index

Examples

Functions

func NewFrameReader

func NewFrameReader(r io.Reader) framing.Reader

func NewReader

func NewReader(r io.Reader) io.Reader

NewReader returns an io.Reader that unpacks the data read from r out of RecordIO framing before returning it.

Source Files

doc.go reader.go

Version
v0.0.3
Published
Jun 19, 2017
Platform
js/wasm
Imports
5 packages
Last checked
1 hour ago

Tools for package owners.