1 package com
.google
.appengine
.tools
.admin
;
3 import java
.io
.BufferedReader
;
4 import java
.io
.IOException
;
5 import java
.io
.InputStream
;
6 import java
.io
.InputStreamReader
;
7 import java
.io
.PrintWriter
;
8 import java
.util
.logging
.Level
;
9 import java
.util
.logging
.Logger
;
12 * Pumps lines from one stream onto another, used specifically for getting
13 * the stdout/stderr of a child process onto the parent's.
17 public class OutputPump
implements Runnable
{
19 private BufferedReader stream
;
20 private PrintWriter output
;
21 private Logger logger
= Logger
.getLogger(OutputPump
.class.getName());
23 public OutputPump(InputStream instream
, PrintWriter outstream
) {
24 stream
= new BufferedReader(new InputStreamReader(instream
));
32 while ((line
= stream
.readLine()) != null) {
35 } catch (IOException ix
) {
36 logger
.log(Level
.SEVERE
, "Unexpected failure while trying to record errors.", ix
);