Class ServletOutputStream
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
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.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprint(boolean value) Writes a boolean.voidprint(char value) Writes a single char.voidprint(double value) Writes a double.voidprint(float value) Writes a float.voidprint(int value) Writes an int.voidprint(long value) Writes a long.voidWrites a String.voidprintln()Writes a CRLF.voidprintln(boolean value) Writes a boolean followed by a CRLF.voidprintln(char value) Writes a single char followed by a CRLF.voidprintln(double value) Writes a double followed by a CRLF.voidprintln(float value) Writes a float followed by a CRLF.voidprintln(int value) Writes an int followed by a CRLF.voidprintln(long value) Writes a long followed by a CRLF.voidWrites a String followed by a CRLF.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write, write
-
Constructor Details
-
ServletOutputStream
protected ServletOutputStream()
-
-
Method Details
-
print
Writes a String.- Parameters:
value- the String to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes a boolean.- Parameters:
value- the boolean to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes a single char.- Parameters:
value- the char to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes an int.- Parameters:
value- the int to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes a long.- Parameters:
value- the long to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes a float.- Parameters:
value- the float to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
print
Writes a double.- Parameters:
value- the double to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a CRLF.- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a String followed by a CRLF.- Parameters:
value- the String to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a boolean followed by a CRLF.- Parameters:
value- the boolean to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a single char followed by a CRLF.- Parameters:
value- the char to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes an int followed by a CRLF.- Parameters:
value- the int to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a long followed by a CRLF.- Parameters:
value- the long to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a float followed by a CRLF.- Parameters:
value- the float to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-
println
Writes a double followed by a CRLF.- Parameters:
value- the double to be printed- Throws:
IOException- if an I/O exception occurs- Since:
- Servlet API 1.0
-