proxy progress

This commit is contained in:
rusefi 2020-07-08 21:23:00 -04:00
parent f14ca0cd7a
commit 565462cf80
1 changed files with 16 additions and 0 deletions

View File

@ -140,4 +140,20 @@ public class IncomingDataBuffer {
cbb.get(packet);
}
}
public byte readByte() throws EOFException {
return (byte) getByte();
}
public int readInt() throws EOFException {
return getInt();
}
public int read(byte[] packet) throws InterruptedException {
boolean timeout = waitForBytes("read", System.currentTimeMillis(), packet.length);
if (timeout)
throw new IllegalStateException("Timeout while waiting " + packet.length);
getData(packet);
return packet.length;
}
}