home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- public class PrintStream extends FilterOutputStream {
- private boolean autoflush;
- private boolean trouble;
-
- public PrintStream(OutputStream out) {
- this(out, false);
- this.trouble = false;
- }
-
- public PrintStream(OutputStream out, boolean autoflush) {
- super(out);
- this.autoflush = autoflush;
- this.trouble = false;
- }
-
- public void write(int b) {
- try {
- super.out.write(b);
- if (this.autoflush && b == 10) {
- super.out.flush();
- return;
- }
- } catch (InterruptedIOException var2) {
- Thread.currentThread().interrupt();
- return;
- } catch (IOException var3) {
- this.trouble = true;
- }
-
- }
-
- public void write(byte[] b, int off, int len) {
- try {
- super.out.write(b, off, len);
- if (this.autoflush) {
- super.out.flush();
- return;
- }
- } catch (InterruptedIOException var4) {
- Thread.currentThread().interrupt();
- return;
- } catch (IOException var5) {
- this.trouble = true;
- }
-
- }
-
- public void flush() {
- try {
- super.flush();
- } catch (IOException var1) {
- this.trouble = true;
- }
- }
-
- public void close() {
- try {
- super.close();
- } catch (IOException var1) {
- this.trouble = true;
- }
- }
-
- public boolean checkError() {
- this.flush();
- return this.trouble;
- }
-
- public void print(Object obj) {
- this.print(String.valueOf(obj));
- }
-
- public synchronized void print(String s) {
- if (s == null) {
- s = "null";
- }
-
- int len = s.length();
-
- for(int i = 0; i < len; ++i) {
- this.write(s.charAt(i));
- }
-
- }
-
- public synchronized void print(char[] s) {
- for(int i = 0; i < s.length; ++i) {
- this.write(s[i]);
- }
-
- }
-
- public void print(char c) {
- this.print(String.valueOf(c));
- }
-
- public void print(int i) {
- this.print(String.valueOf(i));
- }
-
- public void print(long l) {
- this.print(String.valueOf(l));
- }
-
- public void print(float f) {
- this.print(String.valueOf(f));
- }
-
- public void print(double d) {
- this.print(String.valueOf(d));
- }
-
- public void print(boolean b) {
- this.print(b ? "true" : "false");
- }
-
- public void println() {
- this.write(10);
- }
-
- public synchronized void println(Object obj) {
- this.print(obj);
- this.write(10);
- }
-
- public synchronized void println(String s) {
- this.print(s);
- this.write(10);
- }
-
- public synchronized void println(char[] s) {
- this.print(s);
- this.write(10);
- }
-
- public synchronized void println(char c) {
- this.print(c);
- this.write(10);
- }
-
- public synchronized void println(int i) {
- this.print(i);
- this.write(10);
- }
-
- public synchronized void println(long l) {
- this.print(l);
- this.write(10);
- }
-
- public synchronized void println(float f) {
- this.print(f);
- this.write(10);
- }
-
- public synchronized void println(double d) {
- this.print(d);
- this.write(10);
- }
-
- public synchronized void println(boolean b) {
- this.print(b);
- this.write(10);
- }
- }
-