utils

package
v0.0.0-...-9ad5c47 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OffsetReader

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

OffsetReader translates ReaderAt to Reader given a starting offset

func NewOffsetReader

func NewOffsetReader(r io.ReaderAt, off int64) *OffsetReader

func (OffsetReader) Offset

func (r OffsetReader) Offset() int64

Returns the current offset

func (*OffsetReader) Read

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

Uses underlying ReaderAt's ReadAt to read data, increment the offset by the amount of bytes read and returns any underlying error

type OffsetWriter

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

OffsetWriter translates WriterAt to Writer given a starting offset

func NewOffsetWriter

func NewOffsetWriter(w io.WriterAt, off int64) *OffsetWriter

func (OffsetWriter) Offset

func (r OffsetWriter) Offset() int64

Returns the current offset

func (*OffsetWriter) Write

func (w *OffsetWriter) Write(p []byte) (int, error)

Uses underlying WriterAt's WriteAt to write data, increment the offset by the amount of bytes written and returns any underlying error

Jump to

Keyboard shortcuts

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