java.io

Class PrintStream

Implemented Interfaces:
Appendable, Closeable, Flushable
Known Direct Subclasses:
LogStream

public class PrintStream
extends FilterOutputStream
implements Appendable, Closeable

A PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently. Two other features are provided as well. Unlike other output streams, a PrintStream never throws an IOException; instead, exceptional situations merely set an internal flag that can be tested via the checkError method. Optionally, a PrintStream can be created so as to flush automatically; this means that the flush method is automatically invoked after a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written.

All characters printed by a PrintStream are converted into bytes using the platform's default character encoding. The PrintWriter class should be used in situations that require writing characters rather than bytes.

Since:
JDK1.0

Field Summary

Fields inherited from class java.io.FilterOutputStream

out

Constructor Summary

PrintStream(File file)
Creates a new print stream, without automatic line flushing, with the specified file.
PrintStream(File file, String csn)
Creates a new print stream, without automatic line flushing, with the specified file and charset.
PrintStream(OutputStream out)
Create a new print stream.
PrintStream(OutputStream out, boolean autoFlush)
Create a new print stream.
PrintStream(OutputStream out, boolean autoFlush, String encoding)
Create a new print stream.
PrintStream(String fileName)
Creates a new print stream, without automatic line flushing, with the specified file name.
PrintStream(String fileName, String csn)
Creates a new print stream, without automatic line flushing, with the specified file name and charset.

Method Summary

PrintStream
append(char c)
Appends the specified character to this output stream.
PrintStream
append(CharSequence csq)
Appends the specified character sequence to this output stream.
PrintStream
append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this output stream.
boolean
checkError()
Flush the stream and check its error state.
void
close()
Close the stream.
void
flush()
Flush the stream.
PrintStream
format(String format, ... args)
Writes a formatted string to this output stream using the specified format string and arguments.
PrintStream
format(Locale l, String format, ... args)
Writes a formatted string to this output stream using the specified format string and arguments.
void
print(boolean b)
Print a boolean value.
void
print(char c)
Print a character.
void
print(double d)
Print a double-precision floating-point number.
void
print(float f)
Print a floating-point number.
void
print(int i)
Print an integer.
void
print(Object obj)
Print an object.
void
print(String s)
Print a string.
void
print(long l)
Print a long integer.
void
print(s[] )
Print an array of characters.
PrintStream
printf(String format, ... args)
A convenience method to write a formatted string to this output stream using the specified format string and arguments.
PrintStream
printf(Locale l, String format, ... args)
A convenience method to write a formatted string to this output stream using the specified format string and arguments.
void
println()
Terminate the current line by writing the line separator string.
void
println(boolean x)
Print a boolean and then terminate the line.
void
println(char x)
Print a character and then terminate the line.
void
println(double x)
Print a double and then terminate the line.
void
println(float x)
Print a float and then terminate the line.
void
println(int x)
Print an integer and then terminate the line.
void
println(Object x)
Print an Object and then terminate the line.
void
println(String x)
Print a String and then terminate the line.
void
println(long x)
Print a long and then terminate the line.
void
println(x[] )
Print an array of characters and then terminate the line.
protected void
setError()
Set the error state of the stream to true.
void
write(buf[] , int off, int len)
Write len bytes from the specified byte array starting at offset off to this stream.
void
write(int b)
Write the specified byte to this stream.

Methods inherited from class java.io.FilterOutputStream

close, flush, write, write, write

Methods inherited from class java.io.OutputStream

close, flush, write, write, write

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

PrintStream

public PrintStream(File file)
            throws FileNotFoundException
Creates a new print stream, without automatic line flushing, with the specified file. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will encode characters using the default charset for this instance of the Java virtual machine.
Parameters:
file - The file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
Throws:
FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
SecurityException - If a security manager is present and checkWrite(file.getPath()) denies write access to the file
Since:
1.5
Usages and Demos :

View More Examples of PrintStream(File file)
   1:         sequence = 0;
   2:         pStream = new PrintStream(a);
   3:     }
   4:     
   5:     public void encodeBuffer(InputStream inStream,

View Full Code Here
   1:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   2:         PrintStream ps = new PrintStream(baos);
   3:         ex.printStackTrace(ps);
   4:         ...
   5:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   6:         PrintStream ps = new PrintStream(baos);
   7:         ex.printStackTrace(ps);
   8:         ...
   9:         ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
  10:         PrintStream ps2 = new PrintStream(baos2);
  11:         image.printStackTrace(ps2);

View Full Code Here
   1:         java.io.ByteArrayOutputStream bao = new java.io.ByteArrayOutputStream();
   2:         java.io.PrintStream ps = new java.io.PrintStream(bao);
   3:         e_.printStackTrace(ps);
   4:         ScrolledDialog.showNotice(bao.toString());
   5:         System.out.println(bao.toString());

View Full Code Here
   1:     {
   2:       Thread t1=pipe(_in ,new PrintStream(_sout),exit,false);
   3:         ...
   4:       Thread t2=pipe(_sin,new PrintStream(_out ),exit,true );
   5:       t2.join();
   6:       t1.join();
   7:     }

View Full Code Here
   1:         validate();
   2:         PrintStream ps = new PrintStream((property != null)
   3:             ? (OutputStream) new PropertyOutputStream()
   4:             : (OutputStream) new LogOutputStream(this, Project.MSG_INFO));

View Full Code Here

PrintStream

public PrintStream(File file,
                   String csn)
            throws FileNotFoundException,
                   UnsupportedEncodingException
Creates a new print stream, without automatic line flushing, with the specified file and charset. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will encode characters using the provided charset.
Parameters:
file - The file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
csn - The name of a supported charset
Throws:
FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
SecurityException - If a security manager is presentand checkWrite(file.getPath()) denies write access to the file
UnsupportedEncodingException - If the named charset is not supported
Since:
1.5
Usages and Demos :

View More Examples of PrintStream(File file,String csn)
   1:     System.setIn (input_);
   2:     System.setOut(new PrintStream(output_,true));
   3:         ...
   4:     System.setErr(new PrintStream(error_ ,true));
   5:     display_.clear_screen();
   6: 
   7:     hideShortcuts();

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here

PrintStream

public PrintStream(OutputStream out)
Create a new print stream. This stream will not flush automatically.
Parameters:
out - The output stream to which values and objects will be printed
Usages and Demos :

View More Examples of PrintStream(OutputStream out)
   1:         sequence = 0;
   2:         pStream = new PrintStream(a);
   3:     }
   4:     
   5:     public void encodeBuffer(InputStream inStream,

View Full Code Here
   1:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   2:         PrintStream ps = new PrintStream(baos);
   3:         ex.printStackTrace(ps);
   4:         ...
   5:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   6:         PrintStream ps = new PrintStream(baos);
   7:         ex.printStackTrace(ps);
   8:         ...
   9:         ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
  10:         PrintStream ps2 = new PrintStream(baos2);
  11:         image.printStackTrace(ps2);

View Full Code Here
   1:         java.io.ByteArrayOutputStream bao = new java.io.ByteArrayOutputStream();
   2:         java.io.PrintStream ps = new java.io.PrintStream(bao);
   3:         e_.printStackTrace(ps);
   4:         ScrolledDialog.showNotice(bao.toString());
   5:         System.out.println(bao.toString());

View Full Code Here
   1:     {
   2:       Thread t1=pipe(_in ,new PrintStream(_sout),exit,false);
   3:         ...
   4:       Thread t2=pipe(_sin,new PrintStream(_out ),exit,true );
   5:       t2.join();
   6:       t1.join();
   7:     }

View Full Code Here
   1:         validate();
   2:         PrintStream ps = new PrintStream((property != null)
   3:             ? (OutputStream) new PropertyOutputStream()
   4:             : (OutputStream) new LogOutputStream(this, Project.MSG_INFO));

View Full Code Here

PrintStream

public PrintStream(OutputStream out,
                   boolean autoFlush)
Create a new print stream.
Parameters:
out - The output stream to which values and objects will be printed
autoFlush - A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written
Usages and Demos :

View More Examples of PrintStream(OutputStream out,boolean autoFlush)
   1:     System.setIn (input_);
   2:     System.setOut(new PrintStream(output_,true));
   3:         ...
   4:     System.setErr(new PrintStream(error_ ,true));
   5:     display_.clear_screen();
   6: 
   7:     hideShortcuts();

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here

PrintStream

public PrintStream(OutputStream out,
                   boolean autoFlush,
                   String encoding)
            throws UnsupportedEncodingException
Create a new print stream.
Parameters:
out - The output stream to which values and objects will be printed
autoFlush - A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written
encoding - The name of a supported character encoding
Throws:
UnsupportedEncodingException - If the named encoding is not supported
Usages and Demos :

View More Examples of PrintStream(OutputStream out,boolean autoFlush,String encoding)
   1:         PrintStream stream =
   2:         new PrintStream(System.out, true, encoding);
   3:         System.setOut(stream);
   4:     }
   5:     catch (UnsupportedEncodingException ex) {

View Full Code Here
   1:         byteStream = new ByteArrayOutputStream(4096);
   2:         printStream = new PrintStream(byteStream, false, "UTF8");
   3:     }
   4: 
   5:     protected void beginEntry(final String path, final String mediaType) throws IOException {

View Full Code Here
   1:         try {
   2:             printStream = new PrintStream(stream, false, "UTF8");
   3:             printStream.print(buf.toString());
   4:         }
   5:         finally {

View Full Code Here
   1:         this.encoding = "UTF-8";
   2:         this.out = new PrintStream(out, true, this.encoding);
   3: 
   4:     }

View Full Code Here

PrintStream

public PrintStream(String fileName)
            throws FileNotFoundException
Creates a new print stream, without automatic line flushing, with the specified file name. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will encode characters using the default charset for this instance of the Java virtual machine.
Parameters:
fileName - The name of the file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
Throws:
FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
SecurityException - If a security manager is present and checkWrite(fileName) denies write access to the file
Since:
1.5
Usages and Demos :

View More Examples of PrintStream(String fileName)
   1:         sequence = 0;
   2:         pStream = new PrintStream(a);
   3:     }
   4:     
   5:     public void encodeBuffer(InputStream inStream,

View Full Code Here
   1:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   2:         PrintStream ps = new PrintStream(baos);
   3:         ex.printStackTrace(ps);
   4:         ...
   5:         ByteArrayOutputStream baos = new ByteArrayOutputStream();
   6:         PrintStream ps = new PrintStream(baos);
   7:         ex.printStackTrace(ps);
   8:         ...
   9:         ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
  10:         PrintStream ps2 = new PrintStream(baos2);
  11:         image.printStackTrace(ps2);

View Full Code Here
   1:         java.io.ByteArrayOutputStream bao = new java.io.ByteArrayOutputStream();
   2:         java.io.PrintStream ps = new java.io.PrintStream(bao);
   3:         e_.printStackTrace(ps);
   4:         ScrolledDialog.showNotice(bao.toString());
   5:         System.out.println(bao.toString());

View Full Code Here
   1:     {
   2:       Thread t1=pipe(_in ,new PrintStream(_sout),exit,false);
   3:         ...
   4:       Thread t2=pipe(_sin,new PrintStream(_out ),exit,true );
   5:       t2.join();
   6:       t1.join();
   7:     }

View Full Code Here
   1:         validate();
   2:         PrintStream ps = new PrintStream((property != null)
   3:             ? (OutputStream) new PropertyOutputStream()
   4:             : (OutputStream) new LogOutputStream(this, Project.MSG_INFO));

View Full Code Here

PrintStream

public PrintStream(String fileName,
                   String csn)
            throws FileNotFoundException,
                   UnsupportedEncodingException
Creates a new print stream, without automatic line flushing, with the specified file name and charset. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will encode characters using the provided charset.
Parameters:
fileName - The name of the file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.
csn - The name of a supported charset
Throws:
FileNotFoundException - If the given file object does not denote an existing, writable regular file and a new regular file of that name cannot be created, or if some other error occurs while opening or creating the file
SecurityException - If a security manager is present and checkWrite(fileName) denies write access to the file
UnsupportedEncodingException - If the named charset is not supported
Since:
1.5
Usages and Demos :

View More Examples of PrintStream(String fileName,String csn)
   1:     System.setIn (input_);
   2:     System.setOut(new PrintStream(output_,true));
   3:         ...
   4:     System.setErr(new PrintStream(error_ ,true));
   5:     display_.clear_screen();
   6: 
   7:     hideShortcuts();

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here
   1:     out_=_out;
   2:     output=new PrintStream(_out,true);
   3:   }
   4:         ...
   5:     err_=_err;
   6:     error=new PrintStream(_err,true);
   7:   }
   8: 
   9:   public OutputStream getErrorStream()

View Full Code Here

Method Details

append

public PrintStream append(char c)
Appends the specified character to this output stream.

An invocation of this method of the form out.append(c) behaves in exactly the same way as the invocation

     out.print(c) 
Specified by:
append in interface Appendable
Parameters:
c - The 16-bit character to append
Returns:
This output stream
Since:
1.5
Usages and Demos :

View More Examples of append(char c)
   1:       if( h.type != null || h.path != null) {
   2:         out.append( "(IMAGE " );
   3:         ...
   4:         if ( h.type != null ) out.append( "\t(TYPE \""+h.type+"\")" );
   5:         ...
   6:         if ( h.path != null ) out.append( "\t(PATH \""+h.path+"\")" );
   7:         out.append( ")" );
   8:         ...
   9: 
  10:   void write (PrintStream out) throws IOException {

View Full Code Here
   1:       if( h.type != null || h.path != null) {
   2:         out.append( "(IMAGE " );
   3:         ...
   4:         if ( h.type != null ) out.append( "\t(TYPE \""+h.type+"\")" );
   5:         ...
   6:         if ( h.path != null ) out.append( "\t(PATH \""+h.path+"\")" );
   7:         out.append( ")" );
   8:         ...
   9: 
  10:   public void writeFF2 (PrintStream out) throws IOException {

View Full Code Here

append

public PrintStream append(CharSequence csq)
Appends the specified character sequence to this output stream.

An invocation of this method of the form out.append(csq) behaves in exactly the same way as the invocation

     out.print(csq.toString()) 

Depending on the specification of toString for the character sequence csq, the entire sequence may not be appended. appended. For instance, invoking then toString method of a character buffer will return a subsequence whose content depends upon the buffer's position and limit.

Specified by:
append in interface Appendable
Parameters:
csq - The character sequence to append. If csq is null, then the four characters "null" are appended to this output stream.
Returns:
This character stream
Since:
1.5
Usages and Demos :

View More Examples of append(CharSequence csq)
   1:       if( h.type != null || h.path != null) {
   2:         out.append( "(IMAGE " );
   3:         ...
   4:         if ( h.type != null ) out.append( "\t(TYPE \""+h.type+"\")" );
   5:         ...
   6:         if ( h.path != null ) out.append( "\t(PATH \""+h.path+"\")" );
   7:         out.append( ")" );
   8:         ...
   9: 
  10:   void write (PrintStream out) throws IOException {

View Full Code Here
   1:       if( h.type != null || h.path != null) {
   2:         out.append( "(IMAGE " );
   3:         ...
   4:         if ( h.type != null ) out.append( "\t(TYPE \""+h.type+"\")" );
   5:         ...
   6:         if ( h.path != null ) out.append( "\t(PATH \""+h.path+"\")" );
   7:         out.append( ")" );
   8:         ...
   9: 
  10:   public void writeFF2 (PrintStream out) throws IOException {

View Full Code Here

append

public PrintStream append(CharSequence csq,
                          int start,
                          int end)
Appends a subsequence of the specified character sequence to this output stream.

An invocation of this method of the form out.append(csq, start, end) when csq is not null, behaves in exactly the same way as the invocation

     out.print(csq.subSequence(start, end).toString()) 
Specified by:
append in interface Appendable
Parameters:
csq - The character sequence from which a subsequence will be appended. If csq is null, then characters will be appended as if csq contained the four characters "null".
start - The index of the first character in the subsequence
end - The index of the character following the last character in the subsequence
Returns:
This character stream
Throws:
IndexOutOfBoundsException - If start or end are negative, start is greater than end, or end is greater than csq.length()
Since:
1.5
Usages and Demos :

View More Examples of append(CharSequence csq,int start,int end)
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6: public class MultiplePrintStream extends PrintStream {
   7: 
   8:         ...
   9:     private PrintStream     m_mainStream;
  10:     private PrintStream[]   m_additionalStreams;
  11:         ...
  12:     public PrintStream append(CharSequence csq, int start, int end) {
  13:         m_mainStream.append(csq, start, end);

View Full Code Here

checkError

public boolean checkError()
Flush the stream and check its error state. The internal error state is set to true when the underlying output stream throws an IOException other than InterruptedIOException, and when the setError method is invoked. If an operation on the underlying output stream throws an InterruptedIOException, then the PrintStream converts the exception back into an interrupt by doing:
     Thread.currentThread().interrupt();
 
or the equivalent.
Returns:
True if and only if this stream has encountered an IOException other than InterruptedIOException, or the setError method has been invoked
Usages and Demos :

View More Examples of checkError()
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6: public class MultiplePrintStream extends PrintStream {
   7: 
   8:         ...
   9:     private PrintStream     m_mainStream;
  10:     private PrintStream[]   m_additionalStreams;
  11:         ...
  12:     public boolean checkError() {
  13:         boolean ret = m_mainStream.checkError();

View Full Code Here

close

public void close()
Close the stream. This is done by flushing the stream and then closing the underlying output stream.
Specified by:
close in interface Closeable
Overrides:
close in interface FilterOutputStream
Usages and Demos :

View More Examples of close()
   1:                 
   2:         PrintStream os = new PrintStream( new FileOutputStream(f) );
   3:         os.println( request.getParameter("content") );
   4:         ...
   5:         os.close();
   6:         
   7:         Mapping.getInstance().reset();
   8:     

View Full Code Here
   1:           "Redirecting.java"));
   2:     PrintStream vystup =
   3:         ...
   4:       new PrintStream(
   5:         new BufferedOutputStream(
   6:           new FileOutputStream("test.out")));
   7:     System.setIn(vstup);

View Full Code Here
   1: import java.io.File;
   2: import java.io.PrintStream;
   3: import java.io.FileOutputStream;
   4:         ...
   5:             
   6:             PrintStream out = new PrintStream(new FileOutputStream(tmpFile, true));
   7:             out.println(text);
   8:         ...
   9:             out.flush();
  10:             out.close();
  11:         }

View Full Code Here
   1:     {
   2:         PrintStream out = new PrintStream(
   3:                   new FileOutputStream("OutFile.txt"));
   4:         ...
   5:             out.println("Value at: " + i + " = " + victor.elementAt(i));
   6:         out.close();
   7:     }
   8: }

View Full Code Here
   1:     DataInputStream user;
   2:     PrintStream output;
   3:     
   4:         ...
   5:               input = new DataInputStream( socket.getInputStream() );
   6:             output = new PrintStream( socket.getOutputStream() );
   7:           } catch(IOException e) {
   8:         ...
   9: 
  10:         output.close();

View Full Code Here

flush

public void flush()
Flush the stream. This is done by writing any buffered output bytes to the underlying output stream and then flushing that stream.
Specified by:
flush in interface Flushable
Overrides:
flush in interface FilterOutputStream
Usages and Demos :

View More Examples of flush()
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         out.println(msg);
  10:         out.flush();
  11:     }

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: 
   6:     private PrintStream ps;
   7: 
   8:         ...
   9:     public void flush() {
  10:         ps.flush();
  11:     }
  12:         ...
  13: 
  14:     public PrintStream printStream() {

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: 
   6: public class PrintTeeStream extends PrintStream {
   7: 
   8:         ...
   9: 
  10:             PrintStream ps = (PrintStream)enum.nextElement();
  11: 
  12:         ...
  13: 
  14:             ps.flush();

View Full Code Here
   1: import java.io.PrintStream;
   2: import java.io.OutputStream;
   3:         ...
   4: 
   5:             out.flush();
   6:         }
   7:         
   8:         public static void main(String[] args) 

View Full Code Here
   1: import java.io.File;
   2: import java.io.PrintStream;
   3: import java.io.FileOutputStream;
   4:         ...
   5:             
   6:             PrintStream out = new PrintStream(new FileOutputStream(tmpFile, true));
   7:             out.println(text);
   8:         ...
   9:         
  10:             out.flush();
  11:             out.close();

View Full Code Here

format

public PrintStream format(String format,
                          ... args)
Writes a formatted string to this output stream using the specified format string and arguments.

The locale always used is the one returned by Locale.getDefault(), regardless of any previous invocations of other formatting methods on this object.

Parameters:
format - A format string as described in Format string syntax
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
This output stream
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of format(String format,... args)
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6: public class MultiplePrintStream extends PrintStream {
   7: 
   8:         ...
   9:     private PrintStream     m_mainStream;
  10:     private PrintStream[]   m_additionalStreams;
  11:         ...
  12:     public PrintStream format(String format, Object... args) {
  13:         m_mainStream.format(format, args);

View Full Code Here

format

public PrintStream format(Locale l,
                          String format,
                          ... args)
Writes a formatted string to this output stream using the specified format string and arguments.
Parameters:
l - The locale to apply during formatting. If l is null then no localization is applied.
format - A format string as described in Format string syntax
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
This output stream
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of format(Locale l,String format,... args)
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6: public class MultiplePrintStream extends PrintStream {
   7: 
   8:         ...
   9:     private PrintStream     m_mainStream;
  10:     private PrintStream[]   m_additionalStreams;
  11:         ...
  12:     public PrintStream format(Locale l, String format, Object... args) {
  13:         m_mainStream.format(l, format, args);

View Full Code Here

print

public void print(boolean b)
Print a boolean value. The string produced by String.valueOf(boolean) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
b - The boolean to be printed
Usages and Demos :

View More Examples of print(boolean b)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(char c)
Print a character. The character is translated into one or more bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
c - The char to be printed
Usages and Demos :

View More Examples of print(char c)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(double d)
Print a double-precision floating-point number. The string produced by String.valueOf(double) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
d - The double to be printed
Usages and Demos :

View More Examples of print(double d)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(float f)
Print a floating-point number. The string produced by String.valueOf(float) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
f - The float to be printed
Usages and Demos :

View More Examples of print(float f)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(int i)
Print an integer. The string produced by String.valueOf(int) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
i - The int to be printed
Usages and Demos :

View More Examples of print(int i)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(Object obj)
Print an object. The string produced by the String.valueOf(Object) method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
obj - The Object to be printed
Usages and Demos :

View More Examples of print(Object obj)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(String s)
Print a string. If the argument is null then the string "null" is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
s - The String to be printed
Usages and Demos :

View More Examples of print(String s)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(long l)
Print a long integer. The string produced by String.valueOf(long) is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
l - The long to be printed
Usages and Demos :

View More Examples of print(long l)
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

print

public void print(s[] )
Print an array of characters. The characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Parameters:
Throws:
NullPointerException - If s is null
Usages and Demos :

View More Examples of print(s[] )
   1: 
   2: import java.io.PrintStream;
   3: import java.io.PrintWriter;
   4:         ...
   5: 
   6:     public Printer(PrintStream out) {
   7:         this.out = new PrintWriter(out);
   8:         ...
   9:         for( int i=0; i<indent; i++ )
  10:             out.print("  ");
  11:     }

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("(");
   6:         ...
   7:     out.print(getOperatorSymbol());
   8:         ...
   9:     out.print(" ");

View Full Code Here
   1: 
   2:   public void unparse(PrintStream out)
   3:   {
   4:         ...
   5:     out.print("= ");
   6:     lhs.unparse(out);
   7:         ...
   8:     out.print(" ");
   9:     rhs.unparse(out);

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5:     public static int TRACELEVEL = 0;
   6:     protected static PrintStream stream = null;
   7:     protected static int callDepth = 0;
   8:         ...
   9: 
  10:     public static void initStream(PrintStream s) {
  11:         stream = s;
  12:         ...
  13:         for(int i = 0; i < callDepth; i++)
  14:             stream.print("  ");

View Full Code Here
   1: 
   2: import java.io.PrintStream;
   3: import org.xml.sax.SAXException;
   4:         ...
   5: 
   6:     public void        linearize (int indent, PrintStream ps) {
   7:     for (int x = 0; x < indent; x++) {
   8:         ...
   9:         ps.print(" ");
  10:     }

View Full Code Here

printf

public PrintStream printf(String format,
                          ... args)
A convenience method to write a formatted string to this output stream using the specified format string and arguments.

An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation

     out.format(format, args) 
Parameters:
format - A format string as described in Format string syntax
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
This output stream
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of printf(String format,... args)
   1: import java.io.IOException;
   2: import java.io.PrintStream;
   3: import java.util.LinkedList;
   4:         ...
   5: 
   6:   public void testMaxMethod(PrintStream out) throws IOException {
   7:     int[] numbers = getListOfNumbers();
   8:         ...
   9: 
  10:   public void testPrintMethod(PrintStream out) throws IOException {
  11:     out.println(print("foo", 23, -12, 1.23, getListOfNumbers()));
  12:         ...
  13: 
  14:     out.printf("%s\n", obj);

View Full Code Here
   1:     try {
   2:       result = performTest(commandReader, new PrintStream(out));
   3:     }
   4:         ...
   5:       try {
   6:         PrintStream out_fp = new PrintStream (generate_goals);
   7:         ...
   8:         out_fp.printf("%s", output);
   9:         out_fp.close();
  10:         ...
  11:           PrintStream diff_fp = new PrintStream (diff_file);
  12:           diff_fp.printf("%s", output);

View Full Code Here
   1:       File path = new File(dump_dir, jc.getClassName() + ".bcel");
   2:       PrintStream p = new PrintStream(path);
   3: 
   4:         ...
   5:         for (String iname : inames)
   6:           p.printf("implements %s ", iname);
   7:         p.printf("\n");
   8:         ...
   9:       for (Field f : jc.getFields())
  10:         p.printf("  %s\n", f);
  11: 
  12:         ...
  13:       for (Method m : jc.getMethods())
  14:         p.printf("  %s\n", m);

View Full Code Here
   1:       File path = new File(dump_dir, jc.getClassName() + ".bcel");
   2:       PrintStream p = new PrintStream(path);
   3: 
   4:         ...
   5:         for (String iname : inames)
   6:           p.printf("implements %s ", iname);
   7:         p.printf("\n");
   8:         ...
   9:       for (Field f : jc.getFields())
  10:         p.printf("  %s\n", f);
  11: 
  12:         ...
  13:       for (Method m : jc.getMethods())
  14:         p.printf("  %s\n", m);

View Full Code Here
   1:       for (String var_name : ppt.vars.keySet()) {
   2:         System.out.printf("  var %s%n", var_name);
   3:       }
   4:         ...
   5:         if (print_each_set)
   6:           System.out.printf("ppt %s%n", ppt.name);
   7: 
   8:         ...
   9:           if (!vi.get_type_name().equals ("int") && vi.get_rep_type().equals ("int"))
  10:             System.out.printf("huh '%s' - '%s'%n", vi.get_type_name(),
  11:                                vi.rep_type);
  12:         ...
  13: 
  14:     PrintStream decl_file;

View Full Code Here

printf

public PrintStream printf(Locale l,
                          String format,
                          ... args)
A convenience method to write a formatted string to this output stream using the specified format string and arguments.

An invocation of this method of the form out.printf(l, format, args) behaves in exactly the same way as the invocation

     out.format(l, format, args) 
Parameters:
l - The locale to apply during formatting. If l is null then no localization is applied.
format - A format string as described in Format string syntax
args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by the Java Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
Returns:
This output stream
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of printf(Locale l,String format,... args)
   1:   public static
   2:   <T> void print(Map<T,List<T>> graph, PrintStream ps, int indent) {
   3:     String indentString = "";
   4:         ...
   5:     for (T node : graph.keySet()) {
   6:       ps.printf("%s%s%n", indentString, node);
   7:       for (T child : graph.get(node)) {
   8:         ...
   9:         ps.printf("  %s%s%n", indentString, child);
  10:       }

View Full Code Here
   1:   public static
   2:   <T> void print(Map<T,List<T>> graph, PrintStream ps, int indent) {
   3:     String indentString = "";
   4:         ...
   5:     for (T node : graph.keySet()) {
   6:       ps.printf("%s%s%n", indentString, node);
   7:       for (T child : graph.get(node)) {
   8:         ...
   9:         ps.printf("  %s%s%n", indentString, child);
  10:       }

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6: public class MultiplePrintStream extends PrintStream {
   7: 
   8:         ...
   9:     private PrintStream     m_mainStream;
  10:     private PrintStream[]   m_additionalStreams;
  11:         ...
  12:     public PrintStream printf(Locale l, String format, Object... args) {
  13:         m_mainStream.printf(l, format, args);

View Full Code Here
   1:       File path = new File(dump_dir, jc.getClassName() + ".bcel");
   2:       PrintStream p = new PrintStream(path);
   3: 
   4:         ...
   5:       for (int ii = 0; ii < constants.length; ii++) {
   6:         p.printf("  %d %s\n", ii, constants[ii]);
   7:       }
   8: 
   9:       p.close();

View Full Code Here
   1:       File path = new File(dump_dir, jc.getClassName() + ".bcel");
   2:       PrintStream p = new PrintStream(path);
   3: 
   4:         ...
   5:       for (int ii = 0; ii < constants.length; ii++) {
   6:         p.printf("  %d %s\n", ii, constants[ii]);
   7:       }
   8: 
   9:       p.close();

View Full Code Here

println

public void println()
Terminate the current line by writing the line separator string. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').
Usages and Demos :

View More Examples of println()
   1: import java.io.BufferedInputStream;
   2: import java.io.PrintStream;
   3: import org.expasy.uniprot.models.Entry;
   4:         ...
   5:         EntryReader reader = new EntryReader(new BufferedInputStream(System.in));
   6:         PrintStream out = System.out;
   7:         
   8:         ...
   9:                 out.print(entry.getLocations());
  10:                 out.println();
  11:             }

View Full Code Here
   1: import java.io.PrintStream;
   2: import java.io.OutputStream;
   3:         ...
   4:             out.println("Last-modified: " + modDate.toGMTString());
   5:             out.println();
   6: 
   7:             out.flush();
   8:         }

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: 
   6:     PrintStream test;
   7:     
   8:         ...
   9:         assertNull(text);
  10:         test.println();
  11:         assertEquals("Hello" + System.getProperty("line.separator"), text);

View Full Code Here
   1: import java.io.InputStreamReader;
   2: import java.io.PrintStream;
   3: import org.apache.commons.lang.StringUtils;
   4:         ...
   5: {
   6:     private static void print(Citation citation, PrintStream out)
   7:     {
   8:         ...
   9:             StringUtils.join(citation.getAuthors().iterator(), ", ") : "");
  10:         out.println();
  11:     }
  12:         ...
  13:         };
  14:         PrintStream out = System.out;

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: 
   6:     PrintStream test;
   7:     
   8:         ...
   9:         assertNull(text);
  10:         test.println();
  11:         assertEquals("Hello" + System.getProperty("line.separator"), text);

View Full Code Here

println

public void println(boolean x)
Print a boolean and then terminate the line. This method behaves as though it invokes print(boolean) and then println().
Parameters:
x - The boolean to be printed
Usages and Demos :

View More Examples of println(boolean x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(char x)
Print a character and then terminate the line. This method behaves as though it invokes print(char) and then println().
Parameters:
x - The char to be printed.
Usages and Demos :

View More Examples of println(char x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(double x)
Print a double and then terminate the line. This method behaves as though it invokes print(double) and then println().
Parameters:
x - The double to be printed.
Usages and Demos :

View More Examples of println(double x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(float x)
Print a float and then terminate the line. This method behaves as though it invokes print(float) and then println().
Parameters:
x - The float to be printed.
Usages and Demos :

View More Examples of println(float x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(int x)
Print an integer and then terminate the line. This method behaves as though it invokes print(int) and then println().
Parameters:
x - The int to be printed.
Usages and Demos :

View More Examples of println(int x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(Object x)
Print an Object and then terminate the line. This method behaves as though it invokes print(Object) and then println().
Parameters:
x - The Object to be printed.
Usages and Demos :

View More Examples of println(Object x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(String x)
Print a String and then terminate the line. This method behaves as though it invokes print(String) and then println().
Parameters:
x - The String to be printed.
Usages and Demos :

View More Examples of println(String x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(long x)
Print a long and then terminate the line. This method behaves as though it invokes print(long) and then println().
Parameters:
x - a The long to be printed.
Usages and Demos :

View More Examples of println(long x)
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

println

public void println(x[] )
Print an array of characters and then terminate the line. This method behaves as though it invokes print(char[]) and then println().
Parameters:
Usages and Demos :

View More Examples of println(x[] )
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:             out.println("");
   7: 
   8:         }

View Full Code Here
   1: public final class EchoCommand implements CommandFunc {
   2:     public boolean executeCmd(String a_args, PrintStream a_ostr)
   3:     {
   4:         ...
   5:         {
   6:             a_ostr.println("");
   7:             return true;
   8:         ...
   9:         }
  10:         a_ostr.println("");
  11:         return true;

View Full Code Here
   1:     {
   2:     PrintStream p = new PrintStream(new FileOutputStream(name));
   3:     
   4:         ...
   5:     p.println("#");
   6:         ...
   7:     p.println("one");
   8:     p.println(" two two ");
   9:         ...
  10:     p.println("connect 18.31.12.2 18.31.12.3");
  11:     p.println("");

View Full Code Here
   1: 
   2:     public void exec(String[] args, DataInputStream in, PrintStream out) throws IOException{
   3: 
   4:         ...
   5: 
   6:         out.println("Containers:");
   7: 
   8:         ...
   9: 
  10:             out.println("");
  11: 
  12:         ...
  13: 
  14:         out.println("");

View Full Code Here
   1: {
   2:   static PrintStream outfile;
   3:   
   4:         ...
   5:       }
   6:     outfile.println("");
   7:     
   8:         ...
   9:     outfile.println(texify (m.commentText()));
  10:     
  11:         ...
  12:           {
  13:         outfile = new PrintStream (new FileOutputStream (options[i][1]));

View Full Code Here

setError

protected void setError()
Set the error state of the stream to true.
Since:
JDK1.1

write

public void write(buf[] ,
                  int off,
                  int len)
Write len bytes from the specified byte array starting at offset off to this stream. If automatic flushing is enabled then the flush method will be invoked.

Note that the bytes will be written as given; to write characters that will be translated according to the platform's default character encoding, use the print(char) or println(char) methods.

Parameters:
off - Offset from which to start taking bytes
len - Number of bytes to write
Usages and Demos :

View More Examples of write(buf[] ,int off,int len)
   1: {
   2:   System.out.println("Started test of PrintStream");
   3:   System.out.println("Test 1: Printing Test");
   4:         ...
   5: 
   6:   PrintStream ps = new PrintStream(new FileOutputStream("printstream.out"));
   7:   ps.print(true);
   8:         ...
   9:   ps.println();
  10:   ps.write(barray, 0, barray.length);
  11:   ps.println();

View Full Code Here
   1:             try {
   2:                 PrintStream printStream = new PrintStream(out);
   3:                 byte[] data = new byte[blocksize];
   4:         ...
   5:                     log.debug("wrote "+ size + " bytes (total:"+total+")");
   6:                     printStream.write(data,0,size);
   7:                     printStream.flush();
   8:                 }
   9:                 printStream.close();

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6: public class MultiPrintStream extends PrintStream
   7: {
   8:         ...
   9: 
  10:   public void addStream(PrintStream ps)
  11:   {
  12:         ...
  13:     }
  14:     super.write(buf,off,len);

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: {
   6:     private PrintStream stream;
   7:     
   8:         ...
   9:     {
  10:         stream = new PrintStream(output);
  11:     }
  12:         ...
  13:     public void write(byte[] buf, int off, int len) {
  14:         stream.write(buf, off, len);

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintStream;
   3: import java.io.FileOutputStream;
   4:         ...
   5:         
   6:         PrintStream printStream=null;
   7:         
   8:         ...
   9:                 if (_output != null && byteCnt > 0) {
  10:                     _output.write(buffer, 0, byteCnt);
  11:                     _output.flush();
  12:         ...
  13:                     if (_logFile != null) {
  14:                         printStream.write(buffer, 0, byteCnt);

View Full Code Here

write

public void write(int b)
Write the specified byte to this stream. If the byte is a newline and automatic flushing is enabled then the flush method will be invoked.

Note that the byte is written as given; to write a character that will be translated according to the platform's default character encoding, use the print(char) or println(char) methods.

Overrides:
write in interface FilterOutputStream
Parameters:
b - The byte to be written
Usages and Demos :

View More Examples of write(int b)
   1:         
   2:         PrintStream dest = new PrintStream(socket.getOutputStream());  
   3:         
   4:         ...
   5:         dest.print("HTTP/1.0 200 OK");
   6:         dest.write(CRLF);
   7:         
   8:         dest.print("<h1>Hello HTTP World</h1>");
   9:         

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintStream;
   3: 
   4:         ...
   5: 
   6:     PrintStream test;
   7:     
   8:         ...
   9:     public void testByteArray() throws IOException {
  10:         test.write("Hello\nWorld".getBytes());
  11:         assertEquals("Hello\n", text);
  12:         ...
  13:     public void testByteArray2() throws IOException {
  14:         test.write("01234Hello\nWorld".getBytes(), 5, 11);

View Full Code Here
   1: {
   2:   System.out.println("Started test of PrintStream");
   3:   System.out.println("Test 1: Printing Test");
   4:         ...
   5: 
   6:   PrintStream ps = new PrintStream(new FileOutputStream("printstream.out"));
   7:   ps.print(true);
   8:         ...
   9:   ps.println(ps);
  10:   ps.write('B');
  11:   ps.println();

View Full Code Here
   1: import java.io.InputStream;
   2: import java.io.PrintStream;
   3: import java.net.HttpURLConnection;
   4:         ...
   5:             InputStream is = new BufferedInputStream(s.getInputStream());
   6:             final PrintStream ps = new PrintStream(s.getOutputStream(), true);
   7:                 int nread = 0, r = 0;
   8:         ...
   9:                         try {
  10:                             ps.write(NEWLINE);
  11:                             ps.print("Last-modified: ");
  12:         ...
  13:                             ps.print(getName());
  14:                             ps.write(NEWLINE);

View Full Code Here
   1: import java.io.InputStream;
   2: import java.io.PrintStream;
   3: import java.net.HttpURLConnection;
   4:         ...
   5:             InputStream is = new BufferedInputStream(s.getInputStream());
   6:             final PrintStream ps = new PrintStream(s.getOutputStream(), true);
   7:                 int nread = 0, r = 0;
   8:         ...
   9:                         try {
  10:                             ps.write(NEWLINE);
  11:                             ps.print("Last-modified: ");
  12:         ...
  13:                             ps.print(getName());
  14:                             ps.write(NEWLINE);

View Full Code Here