com.webcodepro.applecommander.storage.physical
Class DosOrder

java.lang.Object
  extended by com.webcodepro.applecommander.storage.physical.ImageOrder
      extended by com.webcodepro.applecommander.storage.physical.DosOrder
Direct Known Subclasses:
NibbleOrder

public class DosOrder
extends ImageOrder

Supports disk images stored in DOS physical order.

Author:
Rob Greene (RobGreene@users.sourceforge.net)

Constructor Summary
DosOrder(ByteArrayImageLayout diskImageManager)
          Construct a DosOrder.
 
Method Summary
protected  int getOffset(int track, int sector)
          Compute the track and sector offset into the disk image.
 boolean isBlockDevice()
          Indicates that this device is block ordered.
 boolean isTrackAndSectorDevice()
          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.
 void writeBlock(int block, byte[] data)
          Write the block to the disk image.
 void writeSector(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
isBlockDevice in class ImageOrder

isTrackAndSectorDevice

public boolean isTrackAndSectorDevice()
Indicates that this device is track and sector ordered.

Specified by:
isTrackAndSectorDevice in class ImageOrder

readSector

public byte[] readSector(int track,
                         int sector)
                  throws java.lang.IllegalArgumentException
Retrieve the specified sector.

Specified by:
readSector in class ImageOrder
Throws:
java.lang.IllegalArgumentException

writeSector

public void writeSector(int track,
                        int sector,
                        byte[] bytes)
                 throws java.lang.IllegalArgumentException
Write the specified sector.

Specified by:
writeSector in class ImageOrder
Throws:
java.lang.IllegalArgumentException

getOffset

protected int getOffset(int track,
                        int sector)
                 throws java.lang.IllegalArgumentException
Compute 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:
readBlock in class ImageOrder

writeBlock

public void writeBlock(int block,
                       byte[] data)
Write the block to the disk image. Note: Defined in terms of reading sectors.

Specified by:
writeBlock in class ImageOrder