Skip to content

Commit

Permalink
[MNG-8460] Implement flush() (#2006)
Browse files Browse the repository at this point in the history
LoggingOutputStream used by default as sysout and syserr
were NOT flushing (def method is empty), and flush happened
only when EOL was printed.

Still, prompts and help:evaluate does print out unterminated
strings.

---

https://issues.apache.org/jira/browse/MNG-8460
  • Loading branch information
cstamas authored Dec 22, 2024
1 parent 575ad37 commit 80107b0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public void write(int b) throws IOException {
}
}

@Override
public void flush() throws IOException {
forceFlush();
}

public void forceFlush() {
if (buf.size() > 0) {
String line = new String(buf.toByteArray(), 0, buf.size());
Expand Down

0 comments on commit 80107b0

Please sign in to comment.