mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[hg] EA-28334 Fix EOFE: read only as much bytes as available.
This commit is contained in:
@@ -106,7 +106,14 @@ public class SocketServer {
|
||||
length = origLength;
|
||||
}
|
||||
byte[] data = new byte[length];
|
||||
inputStream.readFully(data);
|
||||
|
||||
int offset = 0;
|
||||
int available;
|
||||
while ((available = inputStream.available()) > 0) {
|
||||
inputStream.readFully(data, offset, available);
|
||||
offset += available;
|
||||
}
|
||||
|
||||
int skipped = inputStream.skipBytes(origLength - length);
|
||||
if (skipped > 0) {
|
||||
LOG.info(String.format("Skipped %s bytes", skipped));
|
||||
|
||||
Reference in New Issue
Block a user