ServletOutputStream

Java Servlet Programming, 2nd Edition > A. Servlet API Quick Reference > ServletOutputStream

 
< BACKCONTINUE >
ServletOutputStream

Synopsis

Class Name: javax.servlet.ServletOutputStream

Superclass: java.io.OutputStream

Immediate Subclasses: None

Interfaces Implemented: None

Availability: Servlet API 1.0 and later

Description

Provides an output stream for sending binary data back to a client. A servlet obtains a ServletOutputStream object from the getOutputStream( ) method of ServletResponse. Although it includes a range of print( ) and println( ) methods for sending text or HTML, the ServletOutputStream has been superseded by PrintWriter. It should be used only for sending binary data. If you subclass ServletOutputStream, you must provide an implementation of the write(int) method.

Class Summary

public abstract class ServletOutputStream extends java.io.OutputStream {   // Constructors   protected ServletOutputStream();   // Instance methods   public void print(boolean b) throws IOException;   public void print(char c) throws IOException;   public void print(double d) throws IOException;   public void print(float f) throws IOException;   public void print(int i) throws IOException;   public void print(long l) throws IOException;   public void print(String s) throws IOException;   public void println() throws IOException;   public void println(boolean b) throws IOException;   public void println(char c) throws IOException;   public void println(double d) throws IOException;   public void println(float f) throws IOException;   public void println(int i) throws IOException;   public void println(long l) throws IOException;   public void println(String s) throws IOException; }

Constructors

ServletOutputStream()

protected ServletOutputStream()
Description

The default constructor does nothing.

Instance Methods

print()

public void print(boolean b) throws IOException public void print(char c) throws IOException public void print(double d) throws IOException public void print(float f) throws IOException public void print(int i) throws IOException public void print(long l) throws IOException public void print(String s) throws IOException
Description

Writes the given data to the client, without a trailing carriage return/line feed (CRLF).

println()

public void println() throws IOException public void println(boolean b) throws IOException public void println(char c) throws IOException public void println(double d) throws IOException public void println(float f) throws IOException public void println(int i) throws IOException public void println(long l) throws IOException public void println(String s) throws IOException
Description

Writes the given data to the client, with a trailing CRLF. The method with no parameters simply writes a CRLF.


Last updated on 3/20/2003
Java Servlet Programming, 2nd Edition, © 2001 O'Reilly

< BACKCONTINUE >


Java servlet programming
Java Servlet Programming (Java Series)
ISBN: 0596000405
EAN: 2147483647
Year: 2000
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net