|
|
18
|
+import java.nio.ByteBuffer;
|
|
|
19
|
+
|
|
|
20
|
+import com.remoteyourcam.usb.ptp.PacketUtil;
|
|
|
21
|
+
|
|
|
22
|
+public class StorageInfo {
|
|
|
23
|
+
|
|
|
24
|
+ public int storageType;
|
|
|
25
|
+ public int filesystemType;
|
|
|
26
|
+ public int accessCapability;
|
|
|
27
|
+ public long maxCapacity;
|
|
|
28
|
+ public long freeSpaceInBytes;
|
|
|
29
|
+ public int freeSpaceInImages;
|
|
|
30
|
+ public String storageDescription;
|
|
|
31
|
+ public String volumeLabel;
|
|
|
32
|
+
|
|
|
33
|
+ public StorageInfo(ByteBuffer b, int length) {
|
|
|
34
|
+ decode(b, length);
|
|
|
35
|
+ }
|
|
|
36
|
+
|
|
|
37
|
+ private void decode(ByteBuffer b, int length) {
|
|
|
38
|
+ storageType = b.getShort() & 0xffff;
|
|
|
39
|
+ filesystemType = b.getShort() & 0xffff;
|
|
|
40
|
+ accessCapability = b.getShort() & 0xff;
|
|
|
41
|
+ maxCapacity = b.getLong();
|
|
|
42
|
+ freeSpaceInBytes = b.getLong();
|
|
|
43
|
+ freeSpaceInImages = b.getInt();
|
|
|
44
|
+ storageDescription = PacketUtil.readString(b);
|
|
|
45
|
+ volumeLabel = PacketUtil.readString(b);
|
|
|
46
|
+ }
|
|
|
47
|
+}
|