|
@@ -35,9 +35,11 @@ import com.dmdirc.logger.ErrorLevel;
|
35
|
35
|
import com.dmdirc.util.CommandUtils;
|
36
|
36
|
import com.dmdirc.util.io.StreamUtils;
|
37
|
37
|
|
|
38
|
+import com.google.common.io.CharStreams;
|
|
39
|
+
|
38
|
40
|
import java.io.File;
|
39
|
41
|
import java.io.IOException;
|
40
|
|
-import java.util.LinkedList;
|
|
42
|
+import java.io.InputStreamReader;
|
41
|
43
|
import java.util.List;
|
42
|
44
|
|
43
|
45
|
import javax.annotation.Nonnull;
|
|
@@ -88,10 +90,10 @@ public class ExecCommand extends Command {
|
88
|
90
|
StreamUtils.readStream(p.getInputStream());
|
89
|
91
|
StreamUtils.readStream(p.getErrorStream());
|
90
|
92
|
} else {
|
91
|
|
- final List<String> execOutput = new LinkedList<>();
|
92
|
|
- final List<String> errorOutput = new LinkedList<>();
|
93
|
|
- StreamUtils.readStreamIntoList(p.getInputStream(), execOutput);
|
94
|
|
- StreamUtils.readStreamIntoList(p.getErrorStream(), errorOutput);
|
|
93
|
+ final List<String> execOutput = CharStreams.readLines(
|
|
94
|
+ new InputStreamReader(p.getInputStream()));
|
|
95
|
+ final List<String> errorOutput = CharStreams.readLines(
|
|
96
|
+ new InputStreamReader(p.getErrorStream()));
|
95
|
97
|
for (String line : execOutput) {
|
96
|
98
|
sendLine(origin, args.isSilent(), FORMAT_OUTPUT, line);
|
97
|
99
|
}
|