Skip to content

Commit

Permalink
Always flush if a single byte is written to the LineDisciplineTerminal
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Mar 28, 2017
1 parent b8d7c4a commit 42b6177
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,23 @@ private class FilteringOutputStream extends OutputStream {
@Override
public void write(int b) throws IOException {
processOutputByte(b);
flush();
}

@Override
public void write(byte[] b, int off, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
}
for (int i = 0 ; i < len ; i++) {
processOutputByte(b[off + i]);
}
flush();
}

@Override
Expand Down

0 comments on commit 42b6177

Please sign in to comment.