Back to project page USBIPServerForAndroid.
The source code is released under:
GNU General Public License
If you think the Android project USBIPServerForAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.cgutman.usbip.server; // ww w.ja va2s. c om import java.nio.ByteBuffer; import org.cgutman.usbip.server.protocol.UsbIpDevice; import org.cgutman.usbip.server.protocol.UsbIpInterface; public class UsbDeviceInfo { public UsbIpDevice dev; public UsbIpInterface[] interfaces; public int getWireSize() { return UsbIpDevice.WIRE_LENGTH + (UsbIpInterface.WIRE_SIZE * dev.bNumInterfaces); } public byte[] serialize() { byte[] devSerialized = dev.serialize(); ByteBuffer bb = ByteBuffer.allocate(getWireSize()); bb.put(devSerialized); for (UsbIpInterface iface : interfaces) { bb.put(iface.serialize()); } return bb.array(); } }