-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get the capacity response's size for further use.
- Loading branch information
Showing
2 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
lib/src/main/java/net/alphadev/usbstorage/scsi/answer/ReadCapacityResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,26 @@ | ||
package net.alphadev.usbstorage.scsi.answer; | ||
|
||
import static net.alphadev.usbstorage.util.BitStitching.convertToInt; | ||
|
||
/** | ||
* @author Jan Seeger <[email protected]> | ||
*/ | ||
public class ReadCapacityResponse { | ||
public static final int LENGTH = 8; | ||
|
||
private int mBlockSize; | ||
private int mNumberOfBlocks; | ||
|
||
public ReadCapacityResponse(byte[] answer) { | ||
mNumberOfBlocks = convertToInt(answer, 0); | ||
mBlockSize = convertToInt(answer, 4); | ||
} | ||
|
||
public int getBlockSize() { | ||
return mBlockSize; | ||
} | ||
|
||
public int getNumberOfBlocks() { | ||
return mNumberOfBlocks; | ||
} | ||
} |