1 package lejos.nxt.comm;
6 * Implements an InputStream over USB.
8 * @author Lawrie Griffiths
11 public class USBInputStream extends InputStream {
12 private byte buf[] = new byte[64];
13 private int bufIdx = -1, bufSize = -1;
16 if (bufIdx == bufSize) {
18 bufSize = USB.usbRead(buf, 64);
19 } while (bufSize == 0);
23 return buf[bufIdx++] & 0xFF;