Class DosOrder
- java.lang.Object
-
- com.webcodepro.applecommander.storage.physical.ImageOrder
-
- com.webcodepro.applecommander.storage.physical.DosOrder
-
- Direct Known Subclasses:
NibbleOrder
public class DosOrder extends ImageOrder
Supports disk images stored in DOS physical order.
-
-
Constructor Summary
Constructors Constructor Description DosOrder(ByteArrayImageLayout diskImageManager)Construct a DosOrder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Return the name of this image order.protected intgetOffset(int track, int sector)Compute the track and sector offset into the disk image.booleanisBlockDevice()Indicates that this device is block ordered.booleanisTrackAndSectorDevice()Indicates that this device is track and sector ordered.byte[]readBlock(int block)Read the block from the disk image.byte[]readSector(int track, int sector)Retrieve the specified sector.voidwriteBlock(int block, byte[] data)Write the block to the disk image.voidwriteSector(int track, int sector, byte[] bytes)Write the specified sector.-
Methods inherited from class com.webcodepro.applecommander.storage.physical.ImageOrder
format, getBlocksOnDevice, getDiskImageManager, getPhysicalSize, getSectorsPerDisk, getSectorsPerTrack, getTracksPerDisk, isSizeApprox, readBytes, setDiskImageManager, writeBytes
-
-
-
-
Constructor Detail
-
DosOrder
public DosOrder(ByteArrayImageLayout diskImageManager)
Construct a DosOrder.
-
-
Method Detail
-
isBlockDevice
public boolean isBlockDevice()
Indicates that this device is block ordered.- Specified by:
isBlockDevicein classImageOrder
-
isTrackAndSectorDevice
public boolean isTrackAndSectorDevice()
Indicates that this device is track and sector ordered.- Specified by:
isTrackAndSectorDevicein classImageOrder
-
readSector
public byte[] readSector(int track, int sector) throws java.lang.IllegalArgumentExceptionRetrieve the specified sector.- Specified by:
readSectorin classImageOrder- Throws:
java.lang.IllegalArgumentException
-
writeSector
public void writeSector(int track, int sector, byte[] bytes) throws java.lang.IllegalArgumentExceptionWrite the specified sector.- Specified by:
writeSectorin classImageOrder- Throws:
java.lang.IllegalArgumentException
-
getOffset
protected int getOffset(int track, int sector) throws java.lang.IllegalArgumentExceptionCompute the track and sector offset into the disk image. This takes into account what type of format is being dealt with.- Throws:
java.lang.IllegalArgumentException
-
readBlock
public byte[] readBlock(int block)
Read the block from the disk image. Note: Defined in terms of reading sectors.- Specified by:
readBlockin classImageOrder
-
writeBlock
public void writeBlock(int block, byte[] data)Write the block to the disk image. Note: Defined in terms of reading sectors.- Specified by:
writeBlockin classImageOrder
-
getName
public java.lang.String getName()
Return the name of this image order.- Specified by:
getNamein classImageOrder
-
-