Archived
0

Оптимизирован вывод ShellPrintStream

This commit is contained in:
2015-12-16 15:57:03 +03:00
parent d9d2bbaca5
commit 9820ea33a0

View File

@@ -35,17 +35,10 @@ public class ShellPrintStream extends PrintStream {
} }
@Override @Override
public void print(String s) { public void write(byte[] bytes, int off, int len) {
if (consoleReader != null) { if (consoleReader != null) {
println(s); String s = new String(bytes);
} else {
super.print(s);
}
}
@Override
public void println(String s) {
if (consoleReader != null) {
writer.print(ConsoleReader.RESET_LINE); writer.print(ConsoleReader.RESET_LINE);
if (formatter != null) { if (formatter != null) {
writer.print(formatter.format(s)); writer.print(formatter.format(s));
@@ -61,7 +54,7 @@ public class ShellPrintStream extends PrintStream {
} }
writer.flush(); writer.flush();
} else { } else {
super.println(s); super.write(bytes, off, len);
} }
} }