sreader

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SectorReader

type SectorReader struct {
	// contains filtered or unexported fields
}

SectorReader is a relatively memory efficient reader to read blocks from a filecoin lotus generated unsealed sector copy.

func NewSectorReader

func NewSectorReader(f io.Reader) (*SectorReader, error)

NewSectorReader creates a new SectorReader instance.

@input - io reader.

@output - sector reader, error.

func (*SectorReader) Advance

func (sr *SectorReader) Advance() error

Advance advances the current pointer to the start of next block.

@output - error.

func (*SectorReader) GetBufPos

func (sr *SectorReader) GetBufPos() uint64

GetBufPos gets the current position of the sub pointer.

@output - position of the sub pointer.

func (*SectorReader) GetPos

func (sr *SectorReader) GetPos() uint64

GetPos gets the current position of the main pointer.

@output - position of the main pointer.

func (*SectorReader) Read

func (sr *SectorReader) Read(p []byte) (n int, err error)

Read reads p bytes.

@input - input byte slice.

@output - bytes read, error.

Jump to

Keyboard shortcuts

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