@Test public void read() throws IOException { byte[] given = ArrayUtils.join( STANDARD_VERSION.bytes(), VENDOR_EXTENSION_ID.bytes(), VENDOR_EXTENSION_VERSION.bytes(), STR.toBytes(VENDOR_EXTENSION_DESC), FUNCTIONAL_MODE.bytes(), UINT32.ZERO.bytes(), UINT32.ZERO.bytes(), UINT32.ZERO.bytes(), UINT32.ZERO.bytes(), UINT32.ZERO.bytes(), STR.toBytes(MANUFACTURER), STR.toBytes(MODEL), STR.toBytes(DEVICE_VERSION), STR.toBytes(SERIAL_NUMBER) ); DeviceInfo expected = new DeviceInfo( STANDARD_VERSION, VENDOR_EXTENSION_ID, VENDOR_EXTENSION_VERSION, VENDOR_EXTENSION_DESC, FUNCTIONAL_MODE, OPERATIONS_SUPPORTED, EVENTS_SUPPORTED, DEVICE_PROPERTIES_SUPPORTED, CAPTURE_FORMATS, IMAGE_FORMATS, MANUFACTURER, MODEL, DEVICE_VERSION, SERIAL_NUMBER); InputStream givenInputStream = new ByteArrayInputStream(given); DeviceInfo actual = DeviceInfo.read(givenInputStream); assertThat(actual, is(expected)); }
public static DeviceInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); }
DeviceInfo { public static DeviceInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } }
DeviceInfo { public static DeviceInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); }
DeviceInfo { public static DeviceInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); static DeviceInfo read(InputStream is); static DeviceInfo read(PtpInputStream pis); UINT16 getStandardVersion(); UINT32 getVendorExtensionID(); UINT16 getVendorExtensionVersion(); String getVendorExtensionDesc(); UINT16 getFunctionalMode(); List<UINT16> getOperationsSupported(); List<UINT16> getEventsSupported(); List<UINT16> getDevicePropertiesSupported(); List<UINT16> getCaptureFormats(); List<UINT16> getImageFormats(); String getManufacturer(); String getModel(); String getDeviceVersion(); String getSerialNumber(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
DeviceInfo { public static DeviceInfo read(InputStream is) throws IOException { return read(new PtpInputStream(is)); } DeviceInfo(
            UINT16 standardVersion,
            UINT32 vendorExtensionID, UINT16 vendorExtensionVersion, String vendorExtensionDesc,
            UINT16 functionalMode,
            List<UINT16> operationsSupported, List<UINT16> eventsSupported, List<UINT16> devicePropertiesSupported,
            List<UINT16> captureFormats, List<UINT16> imageFormats,
            String manufacturer, String model, String deviceVersion, String serialNumber); static DeviceInfo read(InputStream is); static DeviceInfo read(PtpInputStream pis); UINT16 getStandardVersion(); UINT32 getVendorExtensionID(); UINT16 getVendorExtensionVersion(); String getVendorExtensionDesc(); UINT16 getFunctionalMode(); List<UINT16> getOperationsSupported(); List<UINT16> getEventsSupported(); List<UINT16> getDevicePropertiesSupported(); List<UINT16> getCaptureFormats(); List<UINT16> getImageFormats(); String getManufacturer(); String getModel(); String getDeviceVersion(); String getSerialNumber(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }