base: Index | Files

package recordioiov

import ""

Package recordioiov provides utility functions for dealing with [][]bytes, used by recordio transformers.


Package Files


func Slice Uses

func Slice(buf []byte, size int) []byte

Slice returns a byte slice of the given size. If cap(buf)>=size, then it returns buf[:size]. Else it allocates a new slice on heap.

func TotalBytes Uses

func TotalBytes(buf [][]byte) int

TotalBytes returns the total size of the iovec.

type IOVecReader Uses

type IOVecReader struct {
    // contains filtered or unexported fields

IOVecReader is an io.Reader adapter for [][]byte.

func NewIOVecReader Uses

func NewIOVecReader(buf [][]byte) IOVecReader

NewIOVecReader creates a new io.Reader that reads from the given buf.

func (*IOVecReader) Read Uses

func (r *IOVecReader) Read(p []byte) (int, error)

Read implements the io.Reader interface.

func (*IOVecReader) ReadByte Uses

func (r *IOVecReader) ReadByte() (byte, error)

ReadByte reads one byte from the reader. On EOF, returns (0, io.EOF).

Package recordioiov imports 1 packages (graph) and is imported by 4 packages. Updated 2018-08-31. Refresh now. Tools for package owners.