home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- public class PrintStream extends FilterOutputStream {
- private boolean autoFlush;
- private boolean trouble;
- private BufferedWriter textOut;
- private OutputStreamWriter charOut;
- private boolean closing;
-
- /** @deprecated */
- public PrintStream(OutputStream var1) {
- this(var1, false);
- }
-
- /** @deprecated */
- public PrintStream(OutputStream var1, boolean var2) {
- super(var1);
- this.autoFlush = false;
- this.trouble = false;
- this.closing = false;
- this.autoFlush = var2;
- this.charOut = new OutputStreamWriter(this);
- this.textOut = new BufferedWriter(this.charOut);
- }
-
- private void ensureOpen() throws IOException {
- if (super.out == null) {
- throw new IOException("Stream closed");
- }
- }
-
- public void flush() {
- synchronized(this){}
-
- try {
- try {
- this.ensureOpen();
- super.out.flush();
- } catch (IOException var4) {
- this.trouble = true;
- }
- } catch (Throwable var5) {
- throw var5;
- }
-
- }
-
- public void close() {
- synchronized(this){}
-
- try {
- if (!this.closing) {
- this.closing = true;
-
- try {
- this.textOut.close();
- super.out.close();
- } catch (IOException var4) {
- this.trouble = true;
- }
-
- this.textOut = null;
- this.charOut = null;
- super.out = null;
- }
- } catch (Throwable var5) {
- throw var5;
- }
-
- }
-
- public boolean checkError() {
- if (super.out != null) {
- this.flush();
- }
-
- return this.trouble;
- }
-
- protected void setError() {
- this.trouble = true;
- }
-
- public void write(int var1) {
- try {
- synchronized(this){}
-
- try {
- this.ensureOpen();
- super.out.write(var1);
- if (var1 == 10 && this.autoFlush) {
- super.out.flush();
- }
- } catch (Throwable var6) {
- throw var6;
- }
-
- } catch (InterruptedIOException var7) {
- Thread.currentThread().interrupt();
- } catch (IOException var8) {
- this.trouble = true;
- }
- }
-
- public void write(byte[] var1, int var2, int var3) {
- try {
- synchronized(this){}
-
- try {
- this.ensureOpen();
- super.out.write(var1, var2, var3);
- if (this.autoFlush) {
- super.out.flush();
- }
- } catch (Throwable var8) {
- throw var8;
- }
-
- } catch (InterruptedIOException var9) {
- Thread.currentThread().interrupt();
- } catch (IOException var10) {
- this.trouble = true;
- }
- }
-
- private void write(char[] var1) {
- try {
- synchronized(this){}
-
- try {
- this.ensureOpen();
- this.textOut.write(var1);
- this.textOut.flushBuffer();
- this.charOut.flushBuffer();
- if (this.autoFlush) {
- for(int var4 = 0; var4 < var1.length; ++var4) {
- if (var1[var4] == '\n') {
- super.out.flush();
- }
- }
- }
- } catch (Throwable var8) {
- throw var8;
- }
-
- } catch (InterruptedIOException var9) {
- Thread.currentThread().interrupt();
- } catch (IOException var10) {
- this.trouble = true;
- }
- }
-
- private void write(String var1) {
- try {
- synchronized(this){}
-
- try {
- this.ensureOpen();
- this.textOut.write(var1);
- this.textOut.flushBuffer();
- this.charOut.flushBuffer();
- if (this.autoFlush && var1.indexOf(10) >= 0) {
- super.out.flush();
- }
- } catch (Throwable var6) {
- throw var6;
- }
-
- } catch (InterruptedIOException var7) {
- Thread.currentThread().interrupt();
- } catch (IOException var8) {
- this.trouble = true;
- }
- }
-
- private void newLine() {
- try {
- synchronized(this){}
-
- try {
- this.ensureOpen();
- this.textOut.newLine();
- this.textOut.flushBuffer();
- this.charOut.flushBuffer();
- if (this.autoFlush) {
- super.out.flush();
- }
- } catch (Throwable var5) {
- throw var5;
- }
-
- } catch (InterruptedIOException var6) {
- Thread.currentThread().interrupt();
- } catch (IOException var7) {
- this.trouble = true;
- }
- }
-
- public void print(boolean var1) {
- this.write(var1 ? "true" : "false");
- }
-
- public void print(char var1) {
- this.write(String.valueOf(var1));
- }
-
- public void print(int var1) {
- this.write(String.valueOf(var1));
- }
-
- public void print(long var1) {
- this.write(String.valueOf(var1));
- }
-
- public void print(float var1) {
- this.write(String.valueOf(var1));
- }
-
- public void print(double var1) {
- this.write(String.valueOf(var1));
- }
-
- public void print(char[] var1) {
- this.write(var1);
- }
-
- public void print(String var1) {
- if (var1 == null) {
- var1 = "null";
- }
-
- this.write(var1);
- }
-
- public void print(Object var1) {
- this.write(String.valueOf(var1));
- }
-
- public void println() {
- this.newLine();
- }
-
- public void println(boolean var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(char var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(int var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(long var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var5) {
- throw var5;
- }
-
- }
-
- public void println(float var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(double var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var5) {
- throw var5;
- }
-
- }
-
- public void println(char[] var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(String var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void println(Object var1) {
- synchronized(this){}
-
- try {
- this.print(var1);
- this.newLine();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
- }
-