lba

package
v0.5.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lba provides a library for working with Logical Block Addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogicalBlockAddresser

type LogicalBlockAddresser struct {
	PhysicalBlockSize uint64
	LogicalBlockSize  uint64
}

LogicalBlockAddresser represents Logical Block Addressing.

func New

func New(f *os.File) (lba *LogicalBlockAddresser, err error)

New initializes and returns a LogicalBlockAddresser.

func (*LogicalBlockAddresser) Copy

func (lba *LogicalBlockAddresser) Copy(dst []byte, src []byte, rng Range) (int, error)

Copy copies from src to dst in the specified range.

func (*LogicalBlockAddresser) From

func (lba *LogicalBlockAddresser) From(src []byte, rng Range) ([]byte, error)

From returns a slice from a source slice in the the specified range inclusively.

func (*LogicalBlockAddresser) Make

func (lba *LogicalBlockAddresser) Make(size uint64) []byte

Make returns a slice from a source slice in the the specified range inclusively.

type Range

type Range struct {
	Start uint64
	End   uint64
}

Range represents a range of Logical Block Addresses.

Jump to

Keyboard shortcuts

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