Name
ServletOutputStream
Synopsis
ServletOutputStream
provides an output stream for sending binary data back to a client. A servlet can get a ServletOutputStream
by calling the getOutputStream()
method of ServletResponse
. ServletOutputStream was the only available output method in version 1.0 of the Servlet API. For text and HTML output, it has been supplanted by PrintWriter
objects produced by the getWriter()
method of ServletResponse
. The various print()
and println()
methods should therefore be regarded as legacies.
public abstract class ServletOutputStream extends java.io.OutputStream { // Protected Constructors protected ServletOutputStream(); // Public Instance Methods public void print( long l) throws IOException; public void print( int i) throws IOException; public void print( double d) throws IOException; public void print( float f) throws IOException; public void print( String s) throws IOException; public void print( boolean b) throws IOException; public void print( char c) throws IOException; public void println() throws IOException; public void println( long l) throws IOException; public void println( int i) throws IOException; public void println( double d) throws IOException; public void println( float f) throws IOException; public void println( String s) throws IOException; public void println( boolean b) throws IOException; public void println( char c) throws IOException; ...
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.