mirror of
https://github.com/alibaba/arthas.git
synced 2026-12-01 15:37:07 +00:00
fix output encoding problem. close #376
This commit is contained in:
1 parent
f1c4aa12d0
commit
e5e4cf7146
1 file changed
+5
-3
@@ -2,6 +2,7 @@ package com.taobao.arthas.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
|
||||
@@ -41,12 +42,13 @@ public final class IOUtil {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
InputStreamReader reader = new InputStreamReader(remoteInput);
|
||||
while (true) {
|
||||
int singleByte = remoteInput.read();
|
||||
if (singleByte < 0) {
|
||||
int singleChar = reader.read();
|
||||
if (singleChar == -1) {
|
||||
break;
|
||||
}
|
||||
localOutput.write(singleByte);
|
||||
localOutput.write(singleChar);
|
||||
localOutput.flush();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in new issue
Block a user