padreader

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0, MIT Imports: 4 Imported by: 34

README

go-padreader

Tools for mapping between bit-padded and not-bit-padded byte streams

License

Dual-licensed under MIT + Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(r io.Reader, readerTotalSize uint64) (io.Reader, abi.UnpaddedPieceSize)

New produces a reader that produces the provided reader's bytes with a suffix of NUL bytes.

func NewInflator

func NewInflator(r io.Reader, readerTotalSize uint64, targetSize abi.UnpaddedPieceSize) (io.Reader, error)

NewInflator wraps a reader so that it will return enough bytes to exactly fill the given PieceSize

func PaddedSize

func PaddedSize(size uint64) abi.UnpaddedPieceSize

PaddedSize is an unfortunately-misnamed method: it returns the `unpadded` (payload bearing) size of the smallest piece that could fit the provided `size` payload.

Types

This section is empty.

Jump to

Keyboard shortcuts

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