javax.servlet
Class ServletOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--javax.servlet.ServletOutputStream

public abstract class ServletOutputStream
extends java.io.OutputStream

Used to write output from a Servlet to the client. Servlet engines should provide a subclass of ServletOutputStream that implements OutputStream.write(int).

Note that I (MJW) do not understand how the print methods work when the stream uses something else then a simple ASCII character encoding. It seems saver to use ServletResponse.getWriter() for all output that is not binary.

Since:
Servlet API 1.0
Version:
Servlet API 2.1

Constructor Summary
protected ServletOutputStream()
           
 
Method Summary
 void print(boolean value)
          Writes a boolean.
 void print(char value)
          Writes a single char.
 void print(double value)
          Writes a double.
 void print(float value)
          Writes a float.
 void print(int value)
          Writes an int.
 void print(long value)
          Writes a long.
 void print(java.lang.String value)
          Writes a String.
 void println()
          Writes a CRLF.
 void println(boolean value)
          Writes a boolean followed by a CRLF.
 void println(char value)
          Writes a single char followed by a CRLF.
 void println(double value)
          Writes a double followed by a CRLF.
 void println(float value)
          Writes a float followed by a CRLF.
 void println(int value)
          Writes an int followed by a CRLF.
 void println(long value)
          Writes a long followed by a CRLF.
 void println(java.lang.String value)
          Writes a String followed by a CRLF.
 
Methods inherited from class java.io.OutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletOutputStream

protected ServletOutputStream()
Method Detail

print

public void print(java.lang.String value)
           throws java.io.IOException
Writes a String.
Parameters:
value - the String to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(boolean value)
           throws java.io.IOException
Writes a boolean.
Parameters:
value - the boolean to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(char value)
           throws java.io.IOException
Writes a single char.
Parameters:
value - the char to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(int value)
           throws java.io.IOException
Writes an int.
Parameters:
value - the int to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(long value)
           throws java.io.IOException
Writes a long.
Parameters:
value - the long to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(float value)
           throws java.io.IOException
Writes a float.
Parameters:
value - the float to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

print

public void print(double value)
           throws java.io.IOException
Writes a double.
Parameters:
value - the double to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println()
             throws java.io.IOException
Writes a CRLF.
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(java.lang.String value)
             throws java.io.IOException
Writes a String followed by a CRLF.
Parameters:
value - the String to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(boolean value)
             throws java.io.IOException
Writes a boolean followed by a CRLF.
Parameters:
value - the boolean to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(char value)
             throws java.io.IOException
Writes a single char followed by a CRLF.
Parameters:
value - the char to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(int value)
             throws java.io.IOException
Writes an int followed by a CRLF.
Parameters:
value - the int to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(long value)
             throws java.io.IOException
Writes a long followed by a CRLF.
Parameters:
value - the long to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(float value)
             throws java.io.IOException
Writes a float followed by a CRLF.
Parameters:
value - the float to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0

println

public void println(double value)
             throws java.io.IOException
Writes a double followed by a CRLF.
Parameters:
value - the double to be printed
Throws:
java.io.IOException - if an I/O exception occurs
Since:
Servlet API 1.0