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:
sjfink 2007-12-20 19:25:03 +00:00
parent af9e03b63c
commit f95a1cb991
1 changed files with 11 additions and 11 deletions

View File

@ -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);