All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.servlet.ServletOutputStream

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

public abstract class ServletOutputStream
extends 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.

Version:
Servlet API 2.0

Constructor Index

 o ServletOutputStream()

Method Index

 o print(boolean)
Writes a boolean.
 o print(char)
Writes a single char.
 o print(double)
Writes a double.
 o print(float)
Writes a float.
 o print(int)
Writes an int.
 o print(long)
Writes a long.
 o print(String)
Writes a String.
 o println()
Writes a CRLF.
 o println(boolean)
Writes a boolean followed by a CRLF.
 o println(char)
Writes a single char followed by a CRLF.
 o println(double)
Writes a double followed by a CRLF.
 o println(float)
Writes a float followed by a CRLF.
 o println(int)
Writes an int followed by a CRLF.
 o println(long)
Writes a long followed by a CRLF.
 o println(String)
Writes a String followed by a CRLF.

Constructors

 o ServletOutputStream
 protected ServletOutputStream()

Methods

 o print
 public void print(String value) throws IOException
Writes a String.

Parameters:
value - the String to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(boolean value) throws IOException
Writes a boolean.

Parameters:
value - the boolean to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(char value) throws IOException
Writes a single char.

Parameters:
value - the char to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(int value) throws IOException
Writes an int.

Parameters:
value - the int to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(long value) throws IOException
Writes a long.

Parameters:
value - the long to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(float value) throws IOException
Writes a float.

Parameters:
value - the float to be printed
Throws: IOException
if an I/O exception occurs
 o print
 public void print(double value) throws IOException
Writes a double.

Parameters:
value - the double to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println() throws IOException
Writes a CRLF.

Throws: IOException
if an I/O exception occurs
 o println
 public void println(String value) throws IOException
Writes a String followed by a CRLF.

Parameters:
value - the String to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(boolean value) throws IOException
Writes a boolean followed by a CRLF.

Parameters:
value - the boolean to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(char value) throws IOException
Writes a single char followed by a CRLF.

Parameters:
value - the char to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(int value) throws IOException
Writes an int followed by a CRLF.

Parameters:
value - the int to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(long value) throws IOException
Writes a long followed by a CRLF.

Parameters:
value - the long to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(float value) throws IOException
Writes a float followed by a CRLF.

Parameters:
value - the float to be printed
Throws: IOException
if an I/O exception occurs
 o println
 public void println(double value) throws IOException
Writes a double followed by a CRLF.

Parameters:
value - the double to be printed
Throws: IOException
if an I/O exception occurs

All Packages  Class Hierarchy  This Package  Previous  Next  Index