Interface BlockDevice
- All Superinterfaces:
CapabilityProvider, Container, Device, HintProvider, InformationProvider
- All Known Implementing Classes:
ProdosOrderedBlockDevice, TrackSectorToBlockAdapter
Represents block devices in the Apple II world. These devices should be
capable of supporting ProDOS and Pascal 512 byte blocks, as well as RDOS
256 byte blocks, and even CP/M 1024 byte blocks. Those statistics should
be supported by the given Geometry.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault intcalculateRequiredBlocks(int size) A handy/common function to calculate the number of blocks needed for the given size.default voidformat()Format a disk.Get information that describes the disk geometry.readBlock(int block) Read a single block from the disk.readRange(int block, int totalBlocks) Read a range of blocks.default DataBuffersizeBuffer(DataBuffer dataBuffer) Size the givenDataBufferto be a multiple of the block size.voidwriteBlock(int block, DataBuffer blockData) Write a single block to the disk.voidwriteRange(int block, DataBuffer rangeData) Write a range of blocks.Methods inherited from interface CapabilityProvider
canMethods inherited from interface HintProvider
is, isAnyMethods inherited from interface InformationProvider
information
-
Field Details
-
STANDARD_BLOCK_SIZE
static final int STANDARD_BLOCK_SIZE- See Also:
-
-
Method Details
-
getGeometry
BlockDevice.Geometry getGeometry()Get information that describes the disk geometry. -
readBlock
Read a single block from the disk. -
readRange
Read a range of blocks. -
writeBlock
Write a single block to the disk. -
writeRange
Write a range of blocks. -
format
default void format()Format a disk. For most disks, this is simply a wipe to all zeros. If this disk has extended format (such as nibble formats), this is the opportunity to write out that format.
NOTE: Adapter type devices have to be cautious about what device is responsible about formatting. For example, a UniDOS disk is 2x400K volumes on an 800K block device -- if they defer formatting to the 800K block device, a format on one volume also wipes out the other (in this case, do not defer to the "parent"). However, if the block adapter contains a nibble-based TrackSectorDevice, the actual formatting needs to get to the nibble device so it can lay down sector markers and the rest of the track structure.
-
calculateRequiredBlocks
default int calculateRequiredBlocks(int size) A handy/common function to calculate the number of blocks needed for the given size. -
sizeBuffer
Size the givenDataBufferto be a multiple of the block size.
-