Documentation
¶
Overview ¶
Package sparse implements sparse byte Extents: written runs of a file that otherwise reads back as zeroes, with copy-on-write sharing of the backing bytes.
Index ¶
- type Extent
- type Extents
- func (x Extents) Clear(off, n int64) Extents
- func (x Extents) Clone() Extents
- func (x Extents) Diff(prev Extents, size int64) ([]Range, []Range)
- func (x Extents) Presence(off, n int64) []bool
- func (x Extents) Ranges(from, to int64) []Range
- func (x Extents) Read(off, n int64) []byte
- func (x Extents) Truncate(size int64) Extents
- func (x Extents) Write(off int64, data []byte) Extents
- type Range
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extents ¶
type Extents []Extent
Extents is a sorted, non-overlapping, non-adjacent list of written runs. Backing byte slices are never mutated after creation, so clones share them.
func (Extents) Diff ¶
Diff returns ranges of x that differ from prev (changed) and ranges written in prev but absent from x (cleared), clipped to [0, size).
Click to show internal directories.
Click to hide internal directories.