public class ScsiBlockDevice extends java.lang.Object implements BlockDeviceDriver
com.github.mjdev.libaums.driver.scsi.commands| Constructor and Description |
|---|
ScsiBlockDevice(UsbCommunication usbCommunication) |
| Modifier and Type | Method and Description |
|---|---|
int |
getBlockSize()
Returns the block size of the block device.
|
void |
init()
Issues a SCSI Inquiry to determine the connected device.
|
void |
read(long devOffset,
java.nio.ByteBuffer dest)
This method reads from the device at the specific device offset.
|
void |
write(long devOffset,
java.nio.ByteBuffer src)
This method writes from the device at the specific device offset.
|
public ScsiBlockDevice(UsbCommunication usbCommunication)
public void init()
throws java.io.IOException
init in interface BlockDeviceDriverjava.io.IOException - If initialing fails due to an unsupported device or if
reading fails.ScsiInquiry,
ScsiInquiryResponse,
ScsiTestUnitReady,
ScsiReadCapacity,
ScsiReadCapacityResponsepublic void read(long devOffset,
java.nio.ByteBuffer dest)
throws java.io.IOException
read in interface BlockDeviceDriverdevOffset - The offset where the reading should begin.dest - The buffer where the data should be read into.java.io.IOException - If reading fails.public void write(long devOffset,
java.nio.ByteBuffer src)
throws java.io.IOException
write in interface BlockDeviceDriverdevOffset - The offset where the writing should begin.src - The buffer with the data to be transferred.java.io.IOException - If writing fails.public int getBlockSize()
BlockDeviceDriverThat means that it is only possible to read or write hole blocks!
getBlockSize in interface BlockDeviceDriver