javax.servlet

Class 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.

Since:
Servlet API 1.0

Constructor Summary

ServletOutputStream()

Method Summary

void
print(String value)
Writes a String.
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
println()
Writes a CRLF.
void
println(String value)
Writes a String followed by 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.

Constructor Details

ServletOutputStream

protected ServletOutputStream()

Method Details

print

public void print(String value)
            throws IOException
Writes a String.
Parameters:
value - the String to be printed
Since:
Servlet API 1.0

print

public void print(boolean value)
            throws IOException
Writes a boolean.
Parameters:
value - the boolean to be printed
Since:
Servlet API 1.0

print

public void print(char value)
            throws IOException
Writes a single char.
Parameters:
value - the char to be printed
Since:
Servlet API 1.0

print

public void print(double value)
            throws IOException
Writes a double.
Parameters:
value - the double to be printed
Since:
Servlet API 1.0

print

public void print(float value)
            throws IOException
Writes a float.
Parameters:
value - the float to be printed
Since:
Servlet API 1.0

print

public void print(int value)
            throws IOException
Writes an int.
Parameters:
value - the int to be printed
Since:
Servlet API 1.0

print

public void print(long value)
            throws IOException
Writes a long.
Parameters:
value - the long to be printed
Since:
Servlet API 1.0

println

public void println()
            throws IOException
Writes a CRLF.
Since:
Servlet API 1.0

println

public void println(String value)
            throws IOException
Writes a String followed by a CRLF.
Parameters:
value - the String to be printed
Since:
Servlet API 1.0

println

public void println(boolean value)
            throws IOException
Writes a boolean followed by a CRLF.
Parameters:
value - the boolean to be printed
Since:
Servlet API 1.0

println

public void println(char value)
            throws IOException
Writes a single char followed by a CRLF.
Parameters:
value - the char to be printed
Since:
Servlet API 1.0

println

public void println(double value)
            throws IOException
Writes a double followed by a CRLF.
Parameters:
value - the double to be printed
Since:
Servlet API 1.0

println

public void println(float value)
            throws IOException
Writes a float followed by a CRLF.
Parameters:
value - the float to be printed
Since:
Servlet API 1.0

println

public void println(int value)
            throws IOException
Writes an int followed by a CRLF.
Parameters:
value - the int to be printed
Since:
Servlet API 1.0

println

public void println(long value)
            throws IOException
Writes a long followed by a CRLF.
Parameters:
value - the long to be printed
Since:
Servlet API 1.0