tweak to attempt to fully drain streams.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2227 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
af9e03b63c
commit
f95a1cb991
|
@ -188,7 +188,7 @@ public abstract class Launcher {
|
|||
try {
|
||||
Thread.sleep(500);
|
||||
} catch (InterruptedException e1) {
|
||||
e1.printStackTrace();
|
||||
// e1.printStackTrace();
|
||||
// just ignore and continue
|
||||
}
|
||||
drain();
|
||||
|
@ -218,7 +218,7 @@ public abstract class Launcher {
|
|||
}
|
||||
|
||||
private void drainAndPrint(BufferedInputStream s, PrintStream p) throws IOException {
|
||||
if (s.available() > 0) {
|
||||
while (s.available() > 0) {
|
||||
byte[] data = new byte[s.available()];
|
||||
s.read(data);
|
||||
p.print(new String(data));
|
||||
|
@ -226,7 +226,7 @@ public abstract class Launcher {
|
|||
}
|
||||
|
||||
private void drainAndCatch(BufferedInputStream s, ByteArrayOutputStream b) throws IOException {
|
||||
if (s.available() > 0) {
|
||||
while (s.available() > 0) {
|
||||
byte[] data = new byte[s.available()];
|
||||
int nRead = s.read(data);
|
||||
b.write(data, 0, nRead);
|
||||
|
|
Loading…
Reference in New Issue