mirror of https://github.com/FOME-Tech/fome-fw.git
proxy progress
This commit is contained in:
parent
040aee993b
commit
3d2cdc6a9b
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue