home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / rmi / rmic / TextAreaOutput.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  827 b   |  36 lines

  1. package sun.rmi.rmic;
  2.  
  3. import java.awt.TextArea;
  4. import java.io.OutputStream;
  5.  
  6. class TextAreaOutput extends OutputStream {
  7.    int count;
  8.    char[] buf;
  9.    TextArea textarea;
  10.  
  11.    TextAreaOutput(TextArea var1) {
  12.       this.textarea = var1;
  13.       this.buf = new char[80];
  14.       this.count = 0;
  15.    }
  16.  
  17.    public void write(int var1) {
  18.       if (this.count >= this.buf.length) {
  19.          this.flush();
  20.       }
  21.  
  22.       this.buf[this.count++] = (char)var1;
  23.       if ((char)var1 == '\n') {
  24.          this.flush();
  25.       }
  26.  
  27.    }
  28.  
  29.    public void flush() {
  30.       this.textarea.enable();
  31.       String var1 = new String(this.buf, 0, this.count);
  32.       this.textarea.appendText(var1);
  33.       this.count = 0;
  34.    }
  35. }
  36.