home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / browser / tonline / ie32.exe / IEXPLORE.CAB / CLASSES.ZIP / java / io / PrintStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-01  |  2.9 KB  |  168 lines

  1. package java.io;
  2.  
  3. public class PrintStream extends FilterOutputStream {
  4.    private boolean autoflush;
  5.    private boolean trouble;
  6.  
  7.    public PrintStream(OutputStream var1) {
  8.       this(var1, false);
  9.       this.trouble = false;
  10.    }
  11.  
  12.    public PrintStream(OutputStream var1, boolean var2) {
  13.       super(var1);
  14.       this.autoflush = var2;
  15.       this.trouble = false;
  16.    }
  17.  
  18.    public void write(int var1) {
  19.       try {
  20.          super.out.write(var1);
  21.          if (this.autoflush && var1 == 10) {
  22.             super.out.flush();
  23.             return;
  24.          }
  25.       } catch (InterruptedIOException var2) {
  26.          Thread.currentThread().interrupt();
  27.          return;
  28.       } catch (IOException var3) {
  29.          this.trouble = true;
  30.       }
  31.  
  32.    }
  33.  
  34.    public void write(byte[] var1, int var2, int var3) {
  35.       try {
  36.          super.out.write(var1, var2, var3);
  37.          if (this.autoflush) {
  38.             super.out.flush();
  39.             return;
  40.          }
  41.       } catch (InterruptedIOException var4) {
  42.          Thread.currentThread().interrupt();
  43.          return;
  44.       } catch (IOException var5) {
  45.          this.trouble = true;
  46.       }
  47.  
  48.    }
  49.  
  50.    public void flush() {
  51.       try {
  52.          super.flush();
  53.       } catch (IOException var1) {
  54.          this.trouble = true;
  55.       }
  56.    }
  57.  
  58.    public void close() {
  59.       try {
  60.          super.close();
  61.       } catch (IOException var1) {
  62.          this.trouble = true;
  63.       }
  64.    }
  65.  
  66.    public boolean checkError() {
  67.       this.flush();
  68.       return this.trouble;
  69.    }
  70.  
  71.    public void print(Object var1) {
  72.       this.print(String.valueOf(var1));
  73.    }
  74.  
  75.    public synchronized void print(String var1) {
  76.       if (var1 == null) {
  77.          var1 = "null";
  78.       }
  79.  
  80.       int var2 = var1.length();
  81.  
  82.       for(int var3 = 0; var3 < var2; ++var3) {
  83.          this.write(var1.charAt(var3));
  84.       }
  85.  
  86.    }
  87.  
  88.    public synchronized void print(char[] var1) {
  89.       for(int var2 = 0; var2 < var1.length; ++var2) {
  90.          this.write(var1[var2]);
  91.       }
  92.  
  93.    }
  94.  
  95.    public void print(char var1) {
  96.       this.print(String.valueOf(var1));
  97.    }
  98.  
  99.    public void print(int var1) {
  100.       this.print(String.valueOf(var1));
  101.    }
  102.  
  103.    public void print(long var1) {
  104.       this.print(String.valueOf(var1));
  105.    }
  106.  
  107.    public void print(float var1) {
  108.       this.print(String.valueOf(var1));
  109.    }
  110.  
  111.    public void print(double var1) {
  112.       this.print(String.valueOf(var1));
  113.    }
  114.  
  115.    public void print(boolean var1) {
  116.       this.print(var1 ? "true" : "false");
  117.    }
  118.  
  119.    public void println() {
  120.       this.write(10);
  121.    }
  122.  
  123.    public synchronized void println(Object var1) {
  124.       this.print(var1);
  125.       this.write(10);
  126.    }
  127.  
  128.    public synchronized void println(String var1) {
  129.       this.print(var1);
  130.       this.write(10);
  131.    }
  132.  
  133.    public synchronized void println(char[] var1) {
  134.       this.print(var1);
  135.       this.write(10);
  136.    }
  137.  
  138.    public synchronized void println(char var1) {
  139.       this.print(var1);
  140.       this.write(10);
  141.    }
  142.  
  143.    public synchronized void println(int var1) {
  144.       this.print(var1);
  145.       this.write(10);
  146.    }
  147.  
  148.    public synchronized void println(long var1) {
  149.       this.print(var1);
  150.       this.write(10);
  151.    }
  152.  
  153.    public synchronized void println(float var1) {
  154.       this.print(var1);
  155.       this.write(10);
  156.    }
  157.  
  158.    public synchronized void println(double var1) {
  159.       this.print(var1);
  160.       this.write(10);
  161.    }
  162.  
  163.    public synchronized void println(boolean var1) {
  164.       this.print(var1);
  165.       this.write(10);
  166.    }
  167. }
  168.