0

We'd just programmed our controller to send a 16 bytes message constantly thru the USB port.

After a successful bulkTransfer, I'm receiving the 16 bytes.

public int bulkTransfer (UsbEndpoint endpoint, byte[] buffer, int offset, int length, int timeout)

Now, how can I make the message readable?

Machado
  • 14,105
  • 13
  • 56
  • 97

1 Answers1

0

You can try to read the byte array as an object:

ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer));

Object obj = in.readObject();

Gabriel
  • 67
  • 2
  • 6