FileDocCategorySizeDatePackage
StreamReader.javaAPI DocphoneME MR2 API (J2ME)2222Wed May 02 18:00:40 BST 2007com.sun.satsa.jcrmic.utils

StreamReader

public class StreamReader extends Thread
This class reads the program output and optionally prints it using the notifier object.

Fields Summary
private BufferedReader
in
Input stream.
private Notifier
notifier
Errors/warnings notifier.
Constructors Summary
public StreamReader(InputStream in, Notifier notifier)
Constructor.

param
in input stream
param
notifier the notifier object

        this.in = new BufferedReader(new InputStreamReader(in));
        this.notifier = notifier;
    
public StreamReader(InputStream in)
Constructor.

param
in input stream

        this.in = new BufferedReader(new InputStreamReader(in));
    
Methods Summary
public voidrun()
The main loop.


        try {
            String s;

            while ((s = in.readLine()) != null) {
                if (notifier != null)
                    notifier.output(s);
            }
        }
        catch (Exception e) {}