block

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package block provides block-level reading and sector I/O for virtual disks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VHDBlockReader

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

VHDBlockReader reads block and sector data from VHD dynamic disks.

func NewVHDBlockReader

func NewVHDBlockReader(r io.ReaderAt, b *types.VHDBlockAllocationTable, sectorSize uint32) *VHDBlockReader

NewVHDBlockReader creates a VHD block reader using a parsed BAT.

func (*VHDBlockReader) BlockCount

func (br *VHDBlockReader) BlockCount() uint32

BlockCount returns the total number of blocks.

func (*VHDBlockReader) BlockSize

func (br *VHDBlockReader) BlockSize() uint32

BlockSize returns the size in bytes of each block.

func (*VHDBlockReader) ReadAt

func (br *VHDBlockReader) ReadAt(p []byte, virtualOffset int64) (int, error)

ReadAt implements io.ReaderAt — reads from the virtual disk address space.

func (*VHDBlockReader) ReadBlock

func (br *VHDBlockReader) ReadBlock(blockIndex uint32) ([]byte, error)

ReadBlock reads the full data of the block at blockIndex (excluding sector bitmap).

func (*VHDBlockReader) ReadSectorBitmap

func (br *VHDBlockReader) ReadSectorBitmap(blockIndex uint32) (*bat.SectorBitmap, error)

ReadSectorBitmap reads the raw sector bitmap for a given block.

type VHDXBlockReader

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

VHDXBlockReader reads block and sector data from VHDX disks.

func NewVHDXBlockReader

func NewVHDXBlockReader(r io.ReaderAt, b *types.VHDXBlockAllocationTable, sectorSize uint32) *VHDXBlockReader

NewVHDXBlockReader creates a VHDX block reader using a parsed BAT.

func (*VHDXBlockReader) BlockCount

func (br *VHDXBlockReader) BlockCount() uint32

BlockCount returns the total number of blocks.

func (*VHDXBlockReader) BlockDescriptor

func (br *VHDXBlockReader) BlockDescriptor(blockIndex uint32) (*types.BlockDescriptor, error)

BlockDescriptor returns the descriptor for a block including its state and sector ranges.

func (*VHDXBlockReader) BlockSize

func (br *VHDXBlockReader) BlockSize() uint32

BlockSize returns the size in bytes of each block.

func (*VHDXBlockReader) ReadAt

func (br *VHDXBlockReader) ReadAt(p []byte, virtualOffset int64) (int, error)

ReadAt implements io.ReaderAt — reads from the virtual disk address space.

func (*VHDXBlockReader) ReadBlock

func (br *VHDXBlockReader) ReadBlock(blockIndex uint32) ([]byte, error)

ReadBlock reads the full data of the block at blockIndex.

Jump to

Keyboard shortcuts

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