proxy it's slow :(
This commit is contained in:
parent
4d5cbb2534
commit
02cf57eafe
|
@ -12,6 +12,8 @@ public interface WriteStream {
|
|||
*/
|
||||
void write(byte[] bytes) throws IOException;
|
||||
|
||||
void flush() throws IOException;
|
||||
|
||||
default void write(byte value) throws IOException {
|
||||
write(new byte[]{value});
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.rusefi.io.serial;
|
|||
|
||||
import com.rusefi.io.IoStream;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class AbstractIoStream implements IoStream {
|
||||
private boolean isClosed;
|
||||
|
||||
|
@ -17,6 +19,10 @@ public abstract class AbstractIoStream implements IoStream {
|
|||
isClosed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClosed() {
|
||||
return isClosed;
|
||||
|
|
|
@ -65,6 +65,12 @@ public class TcpIoStream extends AbstractIoStream {
|
|||
@Override
|
||||
public void write(byte[] bytes) throws IOException {
|
||||
output.write(bytes);
|
||||
flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
super.flush();
|
||||
output.flush();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue