Skip to content

Commit

Permalink
Make AnsiOutputStream#write synchronized to avoid possible problems
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 26, 2017
1 parent 97750d6 commit e73f297
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ public AnsiOutputStream(OutputStream os) {
private static final int BEL = 7;
private static final int SECOND_ST_CHAR = '\\';

// TODO: implement to get perf boost: public void write(byte[] b, int off, int len)

public void write(int data) throws IOException {
@Override
public synchronized void write(int data) throws IOException {
switch (state) {
case LOOKING_FOR_FIRST_ESC_CHAR:
if (data == FIRST_ESC_CHAR) {
Expand Down

0 comments on commit e73f297

Please sign in to comment.