why the heck was this buffer so small?

This commit is contained in:
rusefi 2018-10-13 14:10:08 -04:00
parent 049658dc4e
commit e862e62a9b
1 changed files with 4 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import com.rusefi.io.LinkManager;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
/**
* (c) Andrey Belomutskiy
@ -51,13 +52,13 @@ public class TcpIoStream implements IoStream {
Thread.currentThread().setName("TCP connector loop");
FileLog.MAIN.logLine("Running TCP connection loop");
byte b[] = new byte[1];
byte inputBuffer[] = new byte[256];
while (true) {
try {
int result = input.read(b);
int result = input.read(inputBuffer);
if (result == -1)
throw new IOException("TcpIoStream: End of input?");
listener.onDataArrived(b);
listener.onDataArrived(Arrays.copyOf(inputBuffer, result));
} catch (IOException e) {
System.err.println("TcpIoStream: End of connection");
return;