proxy it's slow :(

This commit is contained in:
rusefi 2020-07-23 22:16:16 -04:00
parent 4d5cbb2534
commit 02cf57eafe
3 changed files with 14 additions and 0 deletions

View File

@ -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});
}

View File

@ -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;

View File

@ -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();
}