@Test public void read() throws IOException { byte[] given = ArrayUtils.join( STORAGE_TYPE.bytes(), FILE_SYSTEM_TYPE.bytes(), ACCESS_CAPABILITY.bytes(), MAX_CAPACITY.bytes(), FREE_SPACE_IN_BYTES.bytes(), FREE_SPACE_IN_IMAGES.bytes(), STR.toBytes(STORAGE_DESCRIPTION), STR.toBytes(VOLUME_LABEL) ); StorageInfo expected = new StorageInfo(STORAGE_TYPE, FILE_SYSTEM_TYPE, ACCESS_CAPABILITY, MAX_CAPACITY, FREE_SPACE_IN_BYTES, FREE_SPACE_IN_IMAGES, STORAGE_DESCRIPTION, VOLUME_LABEL); InputStream givenInputStream = new ByteArrayInputStream(given); StorageInfo actual = StorageInfo.read(givenInputStream); assertThat(actual, is(expected)); }
public static StorageInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); }
StorageInfo { public static StorageInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } }
StorageInfo { public static StorageInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } StorageInfo(UINT16 storageType, UINT16 fileSystemType,
                       UINT16 accessCapability, UINT64 maxCapacity, UINT64 freeSpaceInBytes, UINT32 freeSpaceInImages,
                       String storageDescription, String volumeLabel
    ); }
StorageInfo { public static StorageInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } StorageInfo(UINT16 storageType, UINT16 fileSystemType,
                       UINT16 accessCapability, UINT64 maxCapacity, UINT64 freeSpaceInBytes, UINT32 freeSpaceInImages,
                       String storageDescription, String volumeLabel
    ); static StorageInfo read(InputStream is); static StorageInfo read(PtpInputStream pis); UINT16 getStorageType(); UINT16 getFileSystemType(); UINT16 getAccessCapability(); UINT64 getMaxCapacity(); UINT64 getFreeSpaceInBytes(); UINT32 getFreeSpaceInImages(); String getStorageDescription(); String getVolumeLabel(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
StorageInfo { public static StorageInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } StorageInfo(UINT16 storageType, UINT16 fileSystemType,
                       UINT16 accessCapability, UINT64 maxCapacity, UINT64 freeSpaceInBytes, UINT32 freeSpaceInImages,
                       String storageDescription, String volumeLabel
    ); static StorageInfo read(InputStream is); static StorageInfo read(PtpInputStream pis); UINT16 getStorageType(); UINT16 getFileSystemType(); UINT16 getAccessCapability(); UINT64 getMaxCapacity(); UINT64 getFreeSpaceInBytes(); UINT32 getFreeSpaceInImages(); String getStorageDescription(); String getVolumeLabel(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }