[MNG-8460] Implement flush() (#2006)

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
This commit is contained in:
Tamas Cservenak 2024-12-22 13:24:10 +01:00 committed by GitHub
parent 575ad3719c
commit 80107b05d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ public class LoggingOutputStream extends FilterOutputStream {
} }
} }
@Override
public void flush() throws IOException {
forceFlush();
}
public void forceFlush() { public void forceFlush() {
if (buf.size() > 0) { if (buf.size() > 0) {
String line = new String(buf.toByteArray(), 0, buf.size()); String line = new String(buf.toByteArray(), 0, buf.size());