Math2mat

/home/ythoma/docs/math2mat/svn/wp1/framework/m2mGUI/src/m2m/backend/verifpga/StreamGobbler.java

Go to the documentation of this file.
00001 package m2m.backend.verifpga;
00002 
00003 import java.io.BufferedReader;
00004 import java.io.IOException;
00005 import java.io.InputStream;
00006 import java.io.InputStreamReader;
00007 
00008 
00009 
00010 class StreamGobbler extends Thread
00011 {
00012     InputStream is;
00013     String type;
00014     
00015     StreamGobbler(InputStream is, String type)
00016     {
00017         this.is = is;
00018         this.type = type;
00019     }
00020     
00021     public void run()
00022     {
00023         try
00024         {
00025             InputStreamReader isr = new InputStreamReader(is);
00026             BufferedReader br = new BufferedReader(isr);
00027             String line=null;
00028             while ( (line = br.readLine()) != null)
00029                 System.out.println(type + ">" + line);    
00030             } catch (IOException ioe)
00031               {
00032                 ioe.printStackTrace();  
00033               }
00034     }
00035 }
 All Classes Namespaces Files Functions Variables Enumerations