Archived
0

Zond:fix: ошибка записи в "трубу"

This commit is contained in:
2017-07-17 03:20:39 +03:00
parent b82e9a6a99
commit c12bf89e8f

View File

@@ -24,9 +24,12 @@ public class PipeInputStream extends InputStream {
} }
} }
if ((lastWritePos + strBytes.length) >= 1024) { if ((lastWritePos + strBytes.length) >= buffer.length) {
wallPos = lastWritePos; wallPos = lastWritePos;
lastWritePos = 0; lastWritePos = 0;
if (lastReadPos == wallPos) {
lastReadPos = 0;
}
} }
System.arraycopy(strBytes, 0, this.buffer, lastWritePos, strBytes.length); System.arraycopy(strBytes, 0, this.buffer, lastWritePos, strBytes.length);