Skip to content

Commit e73f297

Browse files
committed
Make AnsiOutputStream#write synchronized to avoid possible problems
1 parent 97750d6 commit e73f297

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

jansi/src/main/java/org/fusesource/jansi/AnsiOutputStream.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ public AnsiOutputStream(OutputStream os) {
7272
private static final int BEL = 7;
7373
private static final int SECOND_ST_CHAR = '\\';
7474

75-
// TODO: implement to get perf boost: public void write(byte[] b, int off, int len)
76-
77-
public void write(int data) throws IOException {
75+
@Override
76+
public synchronized void write(int data) throws IOException {
7877
switch (state) {
7978
case LOOKING_FOR_FIRST_ESC_CHAR:
8079
if (data == FIRST_ESC_CHAR) {

0 commit comments

Comments
 (0)