if (lba < 0 || transferLength < 0 || lba > capacity || (lba + transferLength) > capacity)
{
switch (cdb.getOperationCode())
{
case Write6.OPERATION_CODE :
throw new LogicalBlockAddressOutOfRangeException(true, true, (byte) 4, 1);
default :
throw new LogicalBlockAddressOutOfRangeException(true, true, 2);
}
}
// duplicate file byte buffer to avoid interference with other tasks
buffer = buffer.duplicate();