proxy progress

This commit is contained in:
rusefi 2020-07-09 22:56:41 -04:00
parent 040aee993b
commit 3d2cdc6a9b
1 changed files with 14 additions and 0 deletions

View File

@ -11,4 +11,18 @@ public interface WriteStream {
* this blocking method would transmit the outgoing bytes
*/
void write(byte[] bytes) throws IOException;
default void write(byte value) throws IOException {
write(new byte[]{value});
}
default void writeInt(int v) throws IOException {
byte[] array = new byte[4];
array[0] = (byte) ((v >>> 24) & 0xFF);
array[0] = (byte) ((v >>> 16) & 0xFF);
array[0] = (byte) ((v >>> 8) & 0xFF);
array[0] = (byte) ((v >>> 0) & 0xFF);
write(array);
}
}