java.io

Class PrintWriter

Implemented Interfaces:
Appendable, Closeable, Flushable

public class PrintWriter
extends Writer

Print formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams.

Unlike the PrintStream class, if automatic flushing is enabled it will be done only when one of the println, printf, or format methods is invoked, rather than whenever a newline character happens to be output. These methods use the platform's own notion of line separator rather than the newline character.

Methods in this class never throw I/O exceptions, although some of its constructors may. The client may inquire as to whether any errors have occurred by invoking checkError().

Since:
JDK1.1

Field Summary

protected Writer
out
The underlying character-output stream of this PrintWriter.

Fields inherited from class java.io.Writer

lock

Constructor Summary

PrintWriter(File file)
Creates a new PrintWriter, without automatic line flushing, with the specified file.
PrintWriter(File file, String csn)
Creates a new PrintWriter, without automatic line flushing, with the specified file and charset.
PrintWriter(OutputStream out)
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
PrintWriter(OutputStream out, boolean autoFlush)
Create a new PrintWriter from an existing OutputStream.
PrintWriter(Writer out)
Create a new PrintWriter, without automatic line flushing.
PrintWriter(Writer out, boolean autoFlush)
Create a new PrintWriter.
PrintWriter(String fileName)
Creates a new PrintWriter, without automatic line flushing, with the specified file name.
PrintWriter(String fileName, String csn)
Creates a new PrintWriter, without automatic line flushing, with the specified file name and charset.

Method Summary

PrintWriter
append(char c)
Appends the specified character to this writer.
PrintWriter
append(CharSequence csq)
Appends the specified character sequence to this writer.
PrintWriter
append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this writer.
boolean
checkError()
Flush the stream if it's not closed and check its error state.
void
close()
Close the stream.
void
flush()
Flush the stream.
PrintWriter
format(String format, ... args)
Writes a formatted string to this writer using the specified format string and arguments.
PrintWriter
format(Locale l, String format, ... args)
Writes a formatted string to this writer 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.
PrintWriter
printf(String format, ... args)
A convenience method to write a formatted string to this writer using the specified format string and arguments.
PrintWriter
printf(Locale l, String format, ... args)
A convenience method to write a formatted string to this writer 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 value and then terminate the line.
void
println(char x)
Print a character and then terminate the line.
void
println(double x)
Print a double-precision floating-point number and then terminate the line.
void
println(float x)
Print a floating-point number 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 integer and then terminate the line.
void
println(x[] )
Print an array of characters and then terminate the line.
protected void
setError()
Indicate that an error has occurred.
void
write(buf[] )
Write an array of characters.
void
write(buf[] , int off, int len)
Write A Portion of an array of characters.
void
write(int c)
Write a single character.
void
write(String s)
Write a string.
void
write(String s, int off, int len)
Write a portion of a string.

Methods inherited from class java.io.Writer

append, append, append, close, flush, write, write, write, write, write

Methods inherited from class java.lang.Object

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

Field Details

out

protected Writer out
The underlying character-output stream of this PrintWriter.
Since:
1.2

Constructor Details

PrintWriter

public PrintWriter(File file)
            throws FileNotFoundException
Creates a new PrintWriter, 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 writer. 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 PrintWriter(File file)
   1:     try {
   2:       output = new PrintWriter("Test" + id + ".txt");
   3:     } catch(IOException e) {
   4:       throw new RuntimeException(e);
   5:     }

View Full Code Here
   1:     FileOutputStream fos = new FileOutputStream(file);
   2:     doc.printWithFormat(new PrintWriter((OutputStream)fos));
   3:     fos.close();
   4:   }

View Full Code Here
   1:                                  OutputStream out) {
   2:         PrintWriter writer = new PrintWriter((out != null) ? out : System.err, true);
   3:         printTree(msg, root, PRINT_DEFAULT, writer);
   4:     }

View Full Code Here
   1:         if (destination instanceof Writer) {
   2:             return new PrintWriter((Writer) destination);
   3:         }
   4:         ...
   5:         if (destination instanceof OutputStream) {
   6:             return new PrintWriter((OutputStream) destination);
   7:         }
   8:         ...
   9: 
  10:             return new PrintWriter(url.openConnection().getOutputStream());
  11:         }

View Full Code Here
   1:             else if (traceOutput instanceof OutputStream) {
   2:                 m_traceOutput = new PrintWriter((OutputStream)traceOutput);
   3:             }
   4:             else if (traceOutput instanceof LDAPTraceWriter) {
   5:                 m_traceOutput = traceOutput;

View Full Code Here

PrintWriter

public PrintWriter(File file,
                   String csn)
            throws FileNotFoundException,
                   UnsupportedEncodingException
Creates a new PrintWriter, 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 writer. 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(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 PrintWriter(File file,String csn)
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:     err_=_err;
   2:     error=new PrintWriter(err_,true);
   3:   }
   4: 
   5:   public OutputStream getErrorStream()

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

View Full Code Here

PrintWriter

public PrintWriter(OutputStream out)
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will convert characters into bytes using the default character encoding.
Parameters:
out - An output stream
Usages and Demos :

View More Examples of PrintWriter(OutputStream out)
   1:     try {
   2:       output = new PrintWriter("Test" + id + ".txt");
   3:     } catch(IOException e) {
   4:       throw new RuntimeException(e);
   5:     }

View Full Code Here
   1:     FileOutputStream fos = new FileOutputStream(file);
   2:     doc.printWithFormat(new PrintWriter((OutputStream)fos));
   3:     fos.close();
   4:   }

View Full Code Here
   1:                                  OutputStream out) {
   2:         PrintWriter writer = new PrintWriter((out != null) ? out : System.err, true);
   3:         printTree(msg, root, PRINT_DEFAULT, writer);
   4:     }

View Full Code Here
   1:         if (destination instanceof Writer) {
   2:             return new PrintWriter((Writer) destination);
   3:         }
   4:         ...
   5:         if (destination instanceof OutputStream) {
   6:             return new PrintWriter((OutputStream) destination);
   7:         }
   8:         ...
   9: 
  10:             return new PrintWriter(url.openConnection().getOutputStream());
  11:         }

View Full Code Here
   1:             else if (traceOutput instanceof OutputStream) {
   2:                 m_traceOutput = new PrintWriter((OutputStream)traceOutput);
   3:             }
   4:             else if (traceOutput instanceof LDAPTraceWriter) {
   5:                 m_traceOutput = traceOutput;

View Full Code Here

PrintWriter

public PrintWriter(OutputStream out,
                   boolean autoFlush)
Create a new PrintWriter from an existing OutputStream. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will convert characters into bytes using the default character encoding.
Parameters:
out - An output stream
autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
Usages and Demos :

View More Examples of PrintWriter(OutputStream out,boolean autoFlush)
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:     err_=_err;
   2:     error=new PrintWriter(err_,true);
   3:   }
   4: 
   5:   public OutputStream getErrorStream()

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

View Full Code Here

PrintWriter

public PrintWriter(Writer out)
Create a new PrintWriter, without automatic line flushing.
Parameters:
out - A character-output stream
Usages and Demos :

View More Examples of PrintWriter(Writer out)
   1:     try {
   2:       output = new PrintWriter("Test" + id + ".txt");
   3:     } catch(IOException e) {
   4:       throw new RuntimeException(e);
   5:     }

View Full Code Here
   1:     FileOutputStream fos = new FileOutputStream(file);
   2:     doc.printWithFormat(new PrintWriter((OutputStream)fos));
   3:     fos.close();
   4:   }

View Full Code Here
   1:                                  OutputStream out) {
   2:         PrintWriter writer = new PrintWriter((out != null) ? out : System.err, true);
   3:         printTree(msg, root, PRINT_DEFAULT, writer);
   4:     }

View Full Code Here
   1:         if (destination instanceof Writer) {
   2:             return new PrintWriter((Writer) destination);
   3:         }
   4:         ...
   5:         if (destination instanceof OutputStream) {
   6:             return new PrintWriter((OutputStream) destination);
   7:         }
   8:         ...
   9: 
  10:             return new PrintWriter(url.openConnection().getOutputStream());
  11:         }

View Full Code Here
   1:             else if (traceOutput instanceof OutputStream) {
   2:                 m_traceOutput = new PrintWriter((OutputStream)traceOutput);
   3:             }
   4:             else if (traceOutput instanceof LDAPTraceWriter) {
   5:                 m_traceOutput = traceOutput;

View Full Code Here

PrintWriter

public PrintWriter(Writer out,
                   boolean autoFlush)
Create a new PrintWriter.
Parameters:
out - A character-output stream
autoFlush - A boolean; if true, the println, printf, or format methods will flush the output buffer
Usages and Demos :

View More Examples of PrintWriter(Writer out,boolean autoFlush)
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:     err_=_err;
   2:     error=new PrintWriter(err_,true);
   3:   }
   4: 
   5:   public OutputStream getErrorStream()

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

View Full Code Here

PrintWriter

public PrintWriter(String fileName)
            throws FileNotFoundException
Creates a new PrintWriter, 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 writer. 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 string 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 PrintWriter(String fileName)
   1:     try {
   2:       output = new PrintWriter("Test" + id + ".txt");
   3:     } catch(IOException e) {
   4:       throw new RuntimeException(e);
   5:     }

View Full Code Here
   1:     FileOutputStream fos = new FileOutputStream(file);
   2:     doc.printWithFormat(new PrintWriter((OutputStream)fos));
   3:     fos.close();
   4:   }

View Full Code Here
   1:                                  OutputStream out) {
   2:         PrintWriter writer = new PrintWriter((out != null) ? out : System.err, true);
   3:         printTree(msg, root, PRINT_DEFAULT, writer);
   4:     }

View Full Code Here
   1:         if (destination instanceof Writer) {
   2:             return new PrintWriter((Writer) destination);
   3:         }
   4:         ...
   5:         if (destination instanceof OutputStream) {
   6:             return new PrintWriter((OutputStream) destination);
   7:         }
   8:         ...
   9: 
  10:             return new PrintWriter(url.openConnection().getOutputStream());
  11:         }

View Full Code Here
   1:             else if (traceOutput instanceof OutputStream) {
   2:                 m_traceOutput = new PrintWriter((OutputStream)traceOutput);
   3:             }
   4:             else if (traceOutput instanceof LDAPTraceWriter) {
   5:                 m_traceOutput = traceOutput;

View Full Code Here

PrintWriter

public PrintWriter(String fileName,
                   String csn)
            throws FileNotFoundException,
                   UnsupportedEncodingException
Creates a new PrintWriter, 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 writer. 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 string 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 PrintWriter(String fileName,String csn)
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:         java.io.CharArrayWriter cw = new java.io.CharArrayWriter(  );
   2:         java.io.PrintWriter pw = new java.io.PrintWriter( cw, true );
   3:         e.printStackTrace( pw );
   4: 
   5:         return cw.toString(  );

View Full Code Here
   1:     err_=_err;
   2:     error=new PrintWriter(err_,true);
   3:   }
   4: 
   5:   public OutputStream getErrorStream()

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

View Full Code Here

Method Details

append

public PrintWriter append(char c)
Appends the specified character to this writer.

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

     out.write(c) 
Specified by:
append in interface Appendable
Overrides:
append in interface Writer
Parameters:
c - The 16-bit character to append
Returns:
This writer
Since:
1.5
Usages and Demos :

View More Examples of append(char c)
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.Writer;
   4:         ...
   5:         int size;
   6:         buffer.append("<arg");
   7:         if (name_ != null) {
   8:         ...
   9:             buffer.append(" name=\"");
  10:         ...
  11:             buffer.append(URelaxer.escapeAttrQuot(URelaxer.getString(getName())));

View Full Code Here
   1:       StringBuffer out = new StringBuffer();
   2:       out.append(vi.name());
   3:       if (val == null)
   4:         ...
   5:       else
   6:         out.append(" (val=" + val + ")");
   7:       if (vi.isCanonical())
   8:         ...
   9:         out.append(" (leader) ");
  10:       out.append (" [always_missing=" + always_missing + ", constant="
  11:         ...
  12: 
  13:   public void print_missing (PrintWriter out) {

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5:                 String val = options.getProperty(key);
   6:                 buf.append("[").append(key).append("] = [").append(val).append("]");
   7:             }
   8:         ...
   9:     public static void storeProps(Properties props, File file) throws IOException {
  10:         PrintWriter out = null;
  11:         try {
  12:         ...
  13:             out = new PrintWriter(new BufferedWriter(new FileWriter(file)));

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.Writer;
   4:         ...
   5:         int size;
   6:         buffer.append("<head");
   7:         ...
   8:         buffer.append(">");
   9:         ...
  10:         buffer.append("<title>");

View Full Code Here
   1: import java.io.Writer;
   2: import java.io.PrintWriter;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:         if (values.length > 0) {
   6:             buffer.append(values[0]);
   7:             for (int i = 1;i < values.length;i++) {
   8:         ...
   9:                 buffer.append(" ");
  10:         ...
  11:                 buffer.append(values[i]);

View Full Code Here

append

public PrintWriter append(CharSequence csq)
Appends the specified character sequence to this writer.

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

     out.write(csq.toString()) 

Depending on the specification of toString for the character sequence csq, the entire sequence may not be appended. For instance, invoking the 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
Overrides:
append in interface Writer
Parameters:
csq - The character sequence to append. If csq is null, then the four characters "null" are appended to this writer.
Returns:
This writer
Since:
1.5
Usages and Demos :

View More Examples of append(CharSequence csq)
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.Writer;
   4:         ...
   5:         int size;
   6:         buffer.append("<arg");
   7:         if (name_ != null) {
   8:         ...
   9:             buffer.append(" name=\"");
  10:         ...
  11:             buffer.append(URelaxer.escapeAttrQuot(URelaxer.getString(getName())));

View Full Code Here
   1:       StringBuffer out = new StringBuffer();
   2:       out.append(vi.name());
   3:       if (val == null)
   4:         ...
   5:       else
   6:         out.append(" (val=" + val + ")");
   7:       if (vi.isCanonical())
   8:         ...
   9:         out.append(" (leader) ");
  10:       out.append (" [always_missing=" + always_missing + ", constant="
  11:         ...
  12: 
  13:   public void print_missing (PrintWriter out) {

View Full Code Here
   1: import java.io.OutputStream;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5:                 String val = options.getProperty(key);
   6:                 buf.append("[").append(key).append("] = [").append(val).append("]");
   7:             }
   8:         ...
   9:     public static void storeProps(Properties props, File file) throws IOException {
  10:         PrintWriter out = null;
  11:         try {
  12:         ...
  13:             out = new PrintWriter(new BufferedWriter(new FileWriter(file)));

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.Writer;
   4:         ...
   5:         int size;
   6:         buffer.append("<head");
   7:         ...
   8:         buffer.append(">");
   9:         ...
  10:         buffer.append("<title>");

View Full Code Here
   1: import java.io.Writer;
   2: import java.io.PrintWriter;
   3: import java.io.ByteArrayOutputStream;
   4:         ...
   5:         if (values.length > 0) {
   6:             buffer.append(values[0]);
   7:             for (int i = 1;i < values.length;i++) {
   8:         ...
   9:                 buffer.append(" ");
  10:         ...
  11:                 buffer.append(values[i]);

View Full Code Here

append

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

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.write(csq.subSequence(start, end).toString()) 
Specified by:
append in interface Appendable
Overrides:
append in interface Writer
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 writer
Throws:
IndexOutOfBoundsException - If start or end are negative, start is greater than end, or end is greater than csq.length()
Since:
1.5

checkError

public boolean checkError()
Flush the stream if it's not closed and check its error state. Errors are cumulative; once the stream encounters an error, this routine will return true on all successive calls.
Returns:
True if the print stream has encountered an error, either on the underlying output stream or during a format conversion.
Usages and Demos :

View More Examples of checkError()
   1:     File tmpfile;
   2:     PrintWriter out;
   3: 
   4:         ...
   5:         try {
   6:             out = new PrintWriter(
   7:                     new BufferedWriter(
   8:         ...
   9:         catch (Exception e) { trouble = true; }
  10:         trouble |= out.checkError();
  11:         out = null;

View Full Code Here
   1:     private File tmpfile;
   2:     private PrintWriter out;
   3:     private Signature verifier;
   4:         ...
   5:             verifier.initSign(id.getPrivateKey());
   6:             out = new PrintWriter(
   7:                     new BufferedWriter(
   8:         ...
   9:         catch (Exception e) { trouble = true; }
  10:         trouble |= out.checkError();
  11:         out = null;

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.HashMap;
   4:         ...
   5: 
   6:       PrintWriter out = new PrintWriter(response.getOutputStream());
   7:       KeepAliveSession kaSession = null;
   8:         ...
   9:             endMessage(out);
  10:             outputError= out.checkError();
  11:           }

View Full Code Here

close

public void close()
Close the stream.
Specified by:
close in interface Closeable
Overrides:
close in interface Writer
See Also:
checkError()
Usages and Demos :

View More Examples of close()
   1:   { 
   2:     PrintWriter out = 
   3:         ...
   4:      new PrintWriter(new FileWriter("hello.txt"));
   5:     out.println("Hello, file system!");
   6:         ...
   7:     out.close();
   8:   }

View Full Code Here
   1: {
   2:   private static PrintWriter outFile;
   3:  
   4:         ...
   5: 
   6:     outFile = new PrintWriter(new FileWriter("song.txt"));
   7:     outFile.println(song1.getName());
   8:         ...
   9:     outFile.println(song1.getDuration());
  10:     outFile.close();
  11:   }

View Full Code Here
   1: 
   2:     PrintWriter pw = resp.getWriter();
   3:     pw.print("<html><body>Hello world!</body></html>");
   4:         ...
   5:     pw.close();
   6:   }
   7: }

View Full Code Here
   1: 
   2:     PrintWriter pw = resp.getWriter();
   3:     pw.print("<html><body>Hello world! The time is ");
   4:         ...
   5:     pw.println("</body></html>");
   6:     pw.close();
   7:   }
   8: 
   9: }

View Full Code Here
   1:     res.setContentType("text/html");
   2:     PrintWriter out = res.getWriter();
   3:     out.println("<html><head></head>");
   4:         ...
   5:     out.println(" department!</h1></body></html>");
   6:     out.close();
   7:   }
   8: }

View Full Code Here

flush

public void flush()
Flush the stream.
Specified by:
flush in interface Flushable
Overrides:
flush in interface Writer
See Also:
checkError()
Usages and Demos :

View More Examples of flush()
   1:       double amountDue = price * (1 + tax / 100);
   2:       PrintWriter out = new PrintWriter(System.out);
   3:       Printf3.fprint(out, "Amount due = %8.2f\n", amountDue);
   4:         ...
   5:       out.flush();
   6:    }
   7: }

View Full Code Here
   1:       
   2:       PrintWriter out = new PrintWriter(
   3:         new OutputStreamWriter( System.out, "Cp850") );
   4:         ...
   5:       out.println("Ich kann ? ? ? und ?");
   6:       out.flush();
   7:     }
   8:     catch ( UnsupportedEncodingException e ) { System.err.println(e); }
   9:   }

View Full Code Here
   1:     Socket s = new Socket(host, 80);
   2:     PrintWriter aus = new PrintWriter(s.getOutputStream());
   3:     aus.print("GET / HTTP/1.0\n\n");
   4:         ...
   5:     aus.flush();
   6: 
   7:     BufferedReader in = new BufferedReader(
   8:                                      new InputStreamReader(s.getInputStream()));

View Full Code Here
   1:                                         s.getInputStream()));
   2:         PrintWriter pw = new PrintWriter(s.getOutputStream());
   3:         System.out.println("Who is Sylvia?");
   4:         ...
   5:         pw.println("Who is Sylvia?");
   6:         pw.flush();
   7:         System.out.println(br.readLine());
   8:         s.close();
   9:     }

View Full Code Here
   1:     public Object exec(Object[] args, Context context){
   2:         PrintWriter output = context.getWriter();
   3:         if (output == null){
   4:         ...
   5:         if (args.length == 0){
   6:             output.flush();
   7:         } else {
   8:             undefined(args, context);
   9:         }

View Full Code Here

format

public PrintWriter format(String format,
                          ... args)
Writes a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.

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 writer
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of format(String format,... args)
   1:         
   2:       PrintWriter output = response.getWriter();
   3:       String javaSourceText = request.getParameter("program");
   4:         ...
   5:       
   6:       output.format("%s\r\n", "<html>");
   7:         ...
   8:       output.format("%s\r\n", "<head>");
   9:       output.format("%s\r\n",
  10:         ...
  11:       output.format("%s\r\n", ".keyword {color: #000080; font-weight: bold}");
  12:       output.format("%s\r\n", ".comment {color: #008000}");

View Full Code Here

format

public PrintWriter format(Locale l,
                          String format,
                          ... args)
Writes a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.
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 writer
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of format(Locale l,String format,... args)
   1:         try {
   2:             writeAndClose(new PrintWriter(file), "test1");
   3:             assertEquals("test1", readLine(file, null));
   4:         ...
   5: 
   6:             writeAndClose(new PrintWriter(file, "UTF-16"), "test2");
   7:             assertEquals("test2", readLine(file, "UTF-16"));
   8:         ...
   9: 
  10:             writeAndClose(new PrintWriter(file.getPath()), "test3");
  11:             assertEquals("test3", readLine(file, null));
  12:         ...
  13:         PrintWriter writer = new PrintWriter(stream, true);
  14:         writer.format("Hello, %s!", "World");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

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.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         ...
   8:         oo.print(getClass().getName());
   9:         ...
  10:         oo.print("(");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.io.UnsupportedEncodingException;
   4:         ...
   5: 
   6:     private PrintWriter m_out;
   7: 
   8:         ...
   9:         m_outTimmer = new WhitespaceTrimWriter();
  10:         m_out = new PrintWriter( m_outTimmer );
  11:         print( base );
  12:         ...
  13:         s = StringEscapeUtils.unescapeHtml( s );
  14:         m_out.print( s );

View Full Code Here
   1:             BitSet s1 = new BitSet(); s1.set(hi[0]+1);
   2:             gen.print("!"); PutRange(s1);
   3:         } else {
   4:         ...
   5:             gen.print("(");
   6:             for (i=0; i<=top; i++) {
   7:         ...
   8:                 if (hi[i]==lo[i]) gen.print("ch == " + Ch((char)lo[i]));
   9:                 else if (lo[i]==0) gen.print("ch <= " + Ch((char)hi[i]));
  10:         ...
  11: 
  12:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Scanner.java")));

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import org.abora.gold.collection.basic.IntegerVarArray;
   4:         ...
   5: }
   6: public void printOn(PrintWriter oo) {
   7:     Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: }
  10: public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:     if (numbers instanceof UInt8Array) {
  12:         ...
  13:         oo.print("<");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:     public void printOn(PrintWriter oo) {
   7:         Sequence.printOn(oo, myShift, myNumbers);
   8:         ...
   9: 
  10:     public static void printArrayOn(PrintWriter oo, PrimIntegerArray numbers) {
  11:         if (numbers instanceof UInt8Array) {
  12:         ...
  13:             oo.print("<");

View Full Code Here

printf

public PrintWriter printf(String format,
                          ... args)
A convenience method to write a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.

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 writer
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of printf(String format,... args)
   1: 
   2: import java.io.PrintWriter;
   3: import java.io.IOException;
   4:         ...
   5:       response.setContentType( "text/html" ); 
   6:       PrintWriter out = response.getWriter();
   7: 
   8:         ...
   9:             votes = resultsRS.getInt( 2 );
  10:             out.printf( "%.2f", ( double ) votes / total * 100 );
  11:             out.print( "%  responses: " );

View Full Code Here
   1:     private Random random;
   2:     private PrintWriter resultWriter;
   3: 
   4:         ...
   5:         File outputFile = new File(resultFileName);
   6:         resultWriter = new PrintWriter(new FileWriter(outputFile));
   7: 
   8:         ...
   9:         }
  10:         resultWriter.printf("load\t%d\t%d\t%d\t%d\n", createProfiler.getAverageInMillis(), createProfiler.getCount(), createProfiler.getMinInMillis(), createProfiler.getMaxInMillis());
  11:         resultWriter.flush();
  12:         ...
  13:             }
  14:             resultWriter.printf("update\t%d\t%d\t%d\t%d\n", updateProfiler.getAverageInMillis(), updateProfiler.getCount(), updateProfiler.getMinInMillis(), updateProfiler.getMaxInMillis());

View Full Code Here
   1: import java.lang.reflect.*;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:       for (Object arg : args)
   6:         System.out.printf("%s ", obj_str(arg));
   7:       System.out.printf ("%n");
   8:         ...
   9:       for (Object arg : args)
  10:         System.out.printf("%s ", obj_str(arg));
  11:       System.out.printf ("%n");
  12:         ...
  13:       for (Object arg : args)
  14:         System.out.printf("%s ", obj_str(arg));

View Full Code Here

printf

public PrintWriter printf(Locale l,
                          String format,
                          ... args)
A convenience method to write a formatted string to this writer using the specified format string and arguments. If automatic flushing is enabled, calls to this method will flush the output buffer.

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 writer
Throws:
NullPointerException - If the format is null
Since:
1.5
Usages and Demos :

View More Examples of printf(Locale l,String format,... args)
   1:         try {
   2:             writeAndClose(new PrintWriter(file), "test1");
   3:             assertEquals("test1", readLine(file, null));
   4:         ...
   5: 
   6:             writeAndClose(new PrintWriter(file, "UTF-16"), "test2");
   7:             assertEquals("test2", readLine(file, "UTF-16"));
   8:         ...
   9: 
  10:             writeAndClose(new PrintWriter(file.getPath()), "test3");
  11:             assertEquals("test3", readLine(file, null));
  12:         ...
  13:         PrintWriter writer = new PrintWriter(stream, true);
  14:         writer.printf("Hello, %s!", "World");

View Full Code Here
   1: import java.lang.reflect.*;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: 
   6:       System.out.printf("this = '%s', mi = %s%n", obj_str(obj),
   7:                          methods.get(mi_index));
   8:         ...
   9: 
  10:       System.out.printf("this = '%s', mi = %s%n", obj_str(obj),
  11:                          methods.get(mi_index));
  12:         ...
  13: 
  14:       System.out.printf("this = '%s', mi = %s%n", obj_str(obj),

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:         try{
   2:             PrintWriter writer = new PrintWriter(System.out,true);
   3:             Transaction t1 = new Credit(1000);
   4:         ...
   5:             t1.printAmount(writer);
   6:             writer.println();
   7:             t2.printAmount(writer);
   8:         ...
   9:             writer.println();
  10:         }

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5: public class TextBasedTestListener implements TestListener {
   6:     private PrintWriter out;
   7:     private int testCount;
   8:         ...
   9: 
  10:     public TextBasedTestListener(PrintWriter out) {
  11:         this.out = out;
  12:         ...
  13:         if (testCount % 40 == 0)
  14:             out.println();

View Full Code Here
   1:     public Object exec(Object[] args, Context context){
   2:         PrintWriter output = context.getWriter();
   3:         if (output != null){
   4:         ...
   5:             }
   6:             output.println();
   7:         }
   8:         return null;
   9:     }

View Full Code Here
   1:         res.setContentType("text/plain");
   2:         PrintWriter out=res.getWriter();
   3:         out.println("Query string:");
   4:         ...
   5:         out.println(req.getQueryString());
   6:         out.println();
   7:         out.println("request patameters:");
   8:         Enumeration enum=req.getParameterNames();
   9:         while(enum.hasMoreElements())

View Full Code Here
   1:     res.setContentType("text/plain");
   2:     PrintWriter out = res.getWriter();
   3: 
   4:         ...
   5:       out.println("Servlet info: " + servlet.getServletInfo());
   6:       out.println();
   7:     }
   8:   }
   9: }

View Full Code Here

println

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

View More Examples of println(boolean x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

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 value to be printed
Usages and Demos :

View More Examples of println(char x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

View Full Code Here

println

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

View More Examples of println(double x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

View Full Code Here

println

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

View More Examples of println(float x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

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 value to be printed
Usages and Demos :

View More Examples of println(int x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

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 value to be printed
Usages and Demos :

View More Examples of println(Object x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

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 value to be printed
Usages and Demos :

View More Examples of println(String x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

View Full Code Here

println

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

View More Examples of println(long x)
   1: 
   2:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

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:         PrintWriter out = response.getWriter();
   3:         HttpSession session;
   4:         ...
   5:         response.setContentType("text/html");
   6:         out.println("<HTML>");
   7: 
   8:         ...
   9:         out.print("<TITLE>Questions on ");
  10:             out.print(progress.exam.getCourseTitle()); out.println("</TITLE>");
  11:         ...
  12:         out.print("<BODY BGCOLOR=\""); out.print(BGCOLOR); out.println("\">");

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.Properties;
   4:         ...
   5:         if (m_out != null) try { m_out.flush (); } catch (Throwable ignore) {}
   6:         m_out = new PrintWriter (System.out, true);
   7:     }   
   8:         ...
   9:             m_out.print (usageMsgPrefix (m_usageToolName));
  10:             m_out.println(msg);
  11:         }
  12:         ...
  13:             m_out.print (usageMsgPrefix (m_usageToolName));
  14:             m_out.println(toolNameToCommandName (m_usageToolName) + " " + usageArgsMsg () + ",");

View Full Code Here
   1:                     CopySourcePart(n.pos, 0);
   2:                     gen.println(");");
   3:                     break;
   4:         ...
   5:                     Indent(indent);
   6:                     if (checked.get(n.p1)) gen.println("Get();");
   7:                     else {
   8:         ...
   9:                         gen.print("Expect("); PrintTermName(n.p1); gen.println(");");
  10:                     }
  11:         ...
  12: 
  13:             gen = new PrintWriter(new BufferedWriter(new FileWriter(srcDir + "Parser.java")));}

View Full Code Here
   1: import java.io.StringWriter;
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:             final StringWriter  buf = new StringWriter();
   6:             final PrintWriter   out = new PrintWriter(buf);
   7:             final DateFormat format = DateFormat.getDateTimeInstance();
   8:         ...
   9:             out.print("Maximum      = "); out.println(format.format(new Date(maximum)));
  10:             out.print("Increment    = "); out.print(increment/(24*3600000f));    out.println(" days");
  11:         ...
  12:             out.print("Tick inc.    = "); out.print(   tickAdd); out.print(' '); out.println(getFieldName(   tickField));

View Full Code Here
   1:                      "#define (flag) (value))>");
   2:       System.err.println("    -perFileLine <file> <line>");
   3:       System.err.println("    -conditionalPerFileLine <file> <line for " +
   4:         ...
   5:                            Hashtable conditionalPerFileLines,
   6:                            PrintWriter dspFile,
   7:                            String dspName) {
   8:         ...
   9:           dspFile.println("# Begin Source File");
  10:           dspFile.println("");
  11:         ...
  12:           dspFile.println("SOURCE=\"" + outStr + "\"");

View Full Code Here

setError

protected void setError()
Indicate that an error has occurred.

write

public void write(buf[] )
Write an array of characters. This method cannot be inherited from the Writer class because it must suppress I/O exceptions.
Parameters:
Usages and Demos :

View More Examples of write(buf[] )
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:         getResponse().setBufferSize(10);
   6:         PrintWriter out = getResponse().getWriter();
   7:         out.write("<!-- INFOGLUE AUTO-UPDATE SYSTEM -->\n");
   8:         ...
   9:         {
  10:             out.write("                                                                                ");
  11:         }
  12:         ...
  13:         out.write("\n");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import java.util.ArrayList;
   4:         ...
   5: 
   6:   public void write(PrintWriter writer) {
   7: 
   8:         ...
   9:     writer.write("      <Method class=\"" + this.className + "\"");
  10:     writer.write(" method=\"" + this.methodName + "\"");
  11: 
  12:         ...
  13:     if (this.parameters.isEmpty()) {
  14:       writer.write("/>"); 

View Full Code Here
   1:         BufferedReader read = new BufferedReader(new InputStreamReader(in));
   2:         PrintWriter write = new PrintWriter(new OutputStreamWriter(out));
   3:         String input;
   4:         ...
   5:                 xy = pj.forward(new LP(input));
   6:                 write.write(""+xy.x+"\t"+xy.y+"\n");
   7:                 write.flush();
   8:         ...
   9:             catch(ProjectionException pe){
  10:                 write.write(this.oterr+"\n");
  11:                 write.flush();

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.List;
   4:         ...
   5: {
   6:     PrintWriter _writer;
   7:     boolean _initialized=false;
   8:         ...
   9:             _writer.write("<script type=\"text/javascript\">");
  10:             _writer.write("window.parent.cometd.deliver([");
  11:         ...
  12:             _writer.write(JSON.toString(reply));

View Full Code Here
   1:     
   2:     protected void renderServletDetails(User user, HttpServletRequest req, PrintWriter out, ThreadIndex index, 
   3:                                         int threadOffset, BlogURI visibleEntry, Archive archive) throws IOException {
   4:         ...
   5:             handleRequest(user, req, index, out);
   6:             out.write("</form>\n");
   7:         }            
   8:         ...
   9:     
  10:     private void handleRequest(User user, HttpServletRequest req, ThreadIndex index, PrintWriter out) throws IOException {
  11:         RemoteArchiveBean remote = getRemote(req);
  12:         ...
  13:             out.write("<pre class=\"b_remoteProgress\">");
  14:             out.write(msgs);

View Full Code Here

write

public void write(buf[] ,
                  int off,
                  int len)
Write A Portion of an array of characters.
Parameters:
off - Offset from which to start writing characters
len - Number of characters to write
Usages and Demos :

View More Examples of write(buf[] ,int off,int len)
   1:     res.setContentType("text/plain");
   2:     PrintWriter out = res.getWriter();
   3: 
   4:         ...
   5:       while ((charsRead = in.read(buf)) != -1) {
   6:         out.write(buf, 0, charsRead);
   7:       }
   8:     }
   9:     finally {

View Full Code Here
   1:       res.setContentType("text/html; charset=UTF-8");
   2:       PrintWriter out = new PrintWriter(
   3:         new OutputStreamWriter(res.getOutputStream(), "UTF8"), true);
   4:         ...
   5:       while ((len = reader.read(buf, 0, buf.length)) != -1) {
   6:         out.write(buf, 0, len);
   7:       }
   8:       out.flush();
   9:     }

View Full Code Here
   1:         if (majorType == TEXT_TYPE) {
   2:             PrintWriter out = response.getWriter();
   3:             out.println(greeting);
   4:         ...
   5:         while ((bytes = in.read(b, 0, b.length)) != -1) {
   6:             out.write(b, 0, bytes);
   7:             out.flush();
   8:         }
   9:     }

View Full Code Here
   1:     res.setContentType("text/html");
   2:     PrintWriter out = res.getWriter();
   3: 
   4:         ...
   5: 
   6:   void readConfigFile(String inputFile, PrintWriter out)
   7:     throws java.io.IOException
   8:         ...
   9:     while ((l = in.read(buf,0,bufsz)) > 0) {
  10:       out.write(buf,0,l);
  11:     }
  12:         ...
  13:     OutputStream os = _appConfig.openConfigFileWrite(outputFile);
  14:     PrintWriter ow = new PrintWriter(os);

View Full Code Here
   1:     public Object exec(Object[] args, Context context){
   2:         PrintWriter writer = context.getWriter();
   3:         OutputStream output = context.getOutputStream();
   4:         ...
   5:                         char[] buf = (char[])arg0;
   6:                         writer.write(buf, 0, buf.length);
   7:                     }
   8:         ...
   9:                         byte[] buf = (byte[])arg0;
  10:                         output.write(buf, offset, size);
  11:                     } else {

View Full Code Here

write

public void write(int c)
Write a single character.
Overrides:
write in interface Writer
Parameters:
c - int specifying a character to be written.
Usages and Demos :

View More Examples of write(int c)
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:         getResponse().setBufferSize(10);
   6:         PrintWriter out = getResponse().getWriter();
   7:         out.write("<!-- INFOGLUE AUTO-UPDATE SYSTEM -->\n");
   8:         ...
   9:         {
  10:             out.write("                                                                                ");
  11:         }
  12:         ...
  13:         out.write("\n");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import java.util.ArrayList;
   4:         ...
   5: 
   6:   public void write(PrintWriter writer) {
   7: 
   8:         ...
   9:     writer.write("      <Method class=\"" + this.className + "\"");
  10:     writer.write(" method=\"" + this.methodName + "\"");
  11: 
  12:         ...
  13:     if (this.parameters.isEmpty()) {
  14:       writer.write("/>"); 

View Full Code Here
   1:         BufferedReader read = new BufferedReader(new InputStreamReader(in));
   2:         PrintWriter write = new PrintWriter(new OutputStreamWriter(out));
   3:         String input;
   4:         ...
   5:                 xy = pj.forward(new LP(input));
   6:                 write.write(""+xy.x+"\t"+xy.y+"\n");
   7:                 write.flush();
   8:         ...
   9:             catch(ProjectionException pe){
  10:                 write.write(this.oterr+"\n");
  11:                 write.flush();

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.List;
   4:         ...
   5: {
   6:     PrintWriter _writer;
   7:     boolean _initialized=false;
   8:         ...
   9:             _writer.write("<script type=\"text/javascript\">");
  10:             _writer.write("window.parent.cometd.deliver([");
  11:         ...
  12:             _writer.write(JSON.toString(reply));

View Full Code Here
   1:     
   2:     protected void renderServletDetails(User user, HttpServletRequest req, PrintWriter out, ThreadIndex index, 
   3:                                         int threadOffset, BlogURI visibleEntry, Archive archive) throws IOException {
   4:         ...
   5:             handleRequest(user, req, index, out);
   6:             out.write("</form>\n");
   7:         }            
   8:         ...
   9:     
  10:     private void handleRequest(User user, HttpServletRequest req, ThreadIndex index, PrintWriter out) throws IOException {
  11:         RemoteArchiveBean remote = getRemote(req);
  12:         ...
  13:             out.write("<pre class=\"b_remoteProgress\">");
  14:             out.write(msgs);

View Full Code Here

write

public void write(String s)
Write a string. This method cannot be inherited from the Writer class because it must suppress I/O exceptions.
Overrides:
write in interface Writer
Parameters:
s - String to be written
Usages and Demos :

View More Examples of write(String s)
   1: 
   2: import java.io.PrintWriter;
   3: 
   4:         ...
   5:         getResponse().setBufferSize(10);
   6:         PrintWriter out = getResponse().getWriter();
   7:         out.write("<!-- INFOGLUE AUTO-UPDATE SYSTEM -->\n");
   8:         ...
   9:         {
  10:             out.write("                                                                                ");
  11:         }
  12:         ...
  13:         out.write("\n");

View Full Code Here
   1: 
   2: import java.io.PrintWriter;
   3: import java.util.ArrayList;
   4:         ...
   5: 
   6:   public void write(PrintWriter writer) {
   7: 
   8:         ...
   9:     writer.write("      <Method class=\"" + this.className + "\"");
  10:     writer.write(" method=\"" + this.methodName + "\"");
  11: 
  12:         ...
  13:     if (this.parameters.isEmpty()) {
  14:       writer.write("/>"); 

View Full Code Here
   1:         BufferedReader read = new BufferedReader(new InputStreamReader(in));
   2:         PrintWriter write = new PrintWriter(new OutputStreamWriter(out));
   3:         String input;
   4:         ...
   5:                 xy = pj.forward(new LP(input));
   6:                 write.write(""+xy.x+"\t"+xy.y+"\n");
   7:                 write.flush();
   8:         ...
   9:             catch(ProjectionException pe){
  10:                 write.write(this.oterr+"\n");
  11:                 write.flush();

View Full Code Here
   1: import java.io.IOException;
   2: import java.io.PrintWriter;
   3: import java.util.List;
   4:         ...
   5: {
   6:     PrintWriter _writer;
   7:     boolean _initialized=false;
   8:         ...
   9:             _writer.write("<script type=\"text/javascript\">");
  10:             _writer.write("window.parent.cometd.deliver([");
  11:         ...
  12:             _writer.write(JSON.toString(reply));

View Full Code Here
   1:     
   2:     protected void renderServletDetails(User user, HttpServletRequest req, PrintWriter out, ThreadIndex index, 
   3:                                         int threadOffset, BlogURI visibleEntry, Archive archive) throws IOException {
   4:         ...
   5:             handleRequest(user, req, index, out);
   6:             out.write("</form>\n");
   7:         }            
   8:         ...
   9:     
  10:     private void handleRequest(User user, HttpServletRequest req, ThreadIndex index, PrintWriter out) throws IOException {
  11:         RemoteArchiveBean remote = getRemote(req);
  12:         ...
  13:             out.write("<pre class=\"b_remoteProgress\">");
  14:             out.write(msgs);

View Full Code Here

write

public void write(String s,
                  int off,
                  int len)
Write a portion of a string.
Overrides:
write in interface Writer
Parameters:
s - A String
off - Offset from which to start writing characters
len - Number of characters to write
Usages and Demos :

View More Examples of write(String s,int off,int len)
   1:     res.setContentType("text/plain");
   2:     PrintWriter out = res.getWriter();
   3: 
   4:         ...
   5:       while ((charsRead = in.read(buf)) != -1) {
   6:         out.write(buf, 0, charsRead);
   7:       }
   8:     }
   9:     finally {

View Full Code Here
   1:       res.setContentType("text/html; charset=UTF-8");
   2:       PrintWriter out = new PrintWriter(
   3:         new OutputStreamWriter(res.getOutputStream(), "UTF8"), true);
   4:         ...
   5:       while ((len = reader.read(buf, 0, buf.length)) != -1) {
   6:         out.write(buf, 0, len);
   7:       }
   8:       out.flush();
   9:     }

View Full Code Here
   1:         if (majorType == TEXT_TYPE) {
   2:             PrintWriter out = response.getWriter();
   3:             out.println(greeting);
   4:         ...
   5:         while ((bytes = in.read(b, 0, b.length)) != -1) {
   6:             out.write(b, 0, bytes);
   7:             out.flush();
   8:         }
   9:     }

View Full Code Here
   1:     res.setContentType("text/html");
   2:     PrintWriter out = res.getWriter();
   3: 
   4:         ...
   5: 
   6:   void readConfigFile(String inputFile, PrintWriter out)
   7:     throws java.io.IOException
   8:         ...
   9:     while ((l = in.read(buf,0,bufsz)) > 0) {
  10:       out.write(buf,0,l);
  11:     }
  12:         ...
  13:     OutputStream os = _appConfig.openConfigFileWrite(outputFile);
  14:     PrintWriter ow = new PrintWriter(os);

View Full Code Here
   1:     public Object exec(Object[] args, Context context){
   2:         PrintWriter writer = context.getWriter();
   3:         OutputStream output = context.getOutputStream();
   4:         ...
   5:                         char[] buf = (char[])arg0;
   6:                         writer.write(buf, 0, buf.length);
   7:                     }
   8:         ...
   9:                         byte[] buf = (byte[])arg0;
  10:                         output.write(buf, offset, size);
  11:                     } else {

View Full Code Here