Class ByteArrayImageLayout
- java.lang.Object
-
- com.webcodepro.applecommander.storage.physical.ByteArrayImageLayout
-
- Direct Known Subclasses:
UniversalDiskImageLayout
public class ByteArrayImageLayout extends java.lang.ObjectManages the layout of the physical disk. This hides implementation details, such as if the disk is in 2IMG order.
-
-
Constructor Summary
Constructors Constructor Description ByteArrayImageLayout(byte[] diskImage)Construct a ByteArrayImageLayout.ByteArrayImageLayout(byte[] diskImage, boolean changed)Construct a ByteArrayImageLayout.ByteArrayImageLayout(int size)Construct a ByteArrayImageLayout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getDiskImage()Get the physical disk image.intgetPhysicalSize()Answer with the physical size of this disk volume.booleanhasChanged()Indicates if the disk has changed.byte[]readBytes(int start, int length)Extract a portion of the disk image.voidsetChanged(boolean changed)Set the changed indicator.voidsetDiskImage(byte[] diskImage)Set the physical disk image.voidwriteBytes(int start, byte[] bytes)Write data to the disk image.
-
-
-
Constructor Detail
-
ByteArrayImageLayout
public ByteArrayImageLayout(byte[] diskImage)
Construct a ByteArrayImageLayout.
-
ByteArrayImageLayout
public ByteArrayImageLayout(byte[] diskImage, boolean changed)Construct a ByteArrayImageLayout.
-
ByteArrayImageLayout
public ByteArrayImageLayout(int size)
Construct a ByteArrayImageLayout.
-
-
Method Detail
-
getDiskImage
public byte[] getDiskImage()
Get the physical disk image.
-
setDiskImage
public void setDiskImage(byte[] diskImage)
Set the physical disk image.
-
getPhysicalSize
public int getPhysicalSize()
Answer with the physical size of this disk volume.
-
readBytes
public byte[] readBytes(int start, int length)Extract a portion of the disk image.
-
writeBytes
public void writeBytes(int start, byte[] bytes)Write data to the disk image.
-
hasChanged
public boolean hasChanged()
Indicates if the disk has changed. Triggered when data is written and cleared when data is saved.
-
setChanged
public void setChanged(boolean changed)
Set the changed indicator.
-
-