ServletOutputStream Class  
public abstract class ServletOutputStream extends OutputStream  
 
Object   
   OutputStream   
     ServletOutputStream   

The ServletOutputStream class is used to write binary data to a client machine. It provides overloaded versions of the print() and println() methods that can handle primitive and String datatypes.

ServletOutputStream()  
protected ServletOutputStream() Constructor
 

This constructor does nothing. Because ServletOutputStream is an abstract class, a ServletOutputStream object is never created directly.

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 str) throws IOException
Method
 

print() prints the specified primitive datatype or String to the client without a carriage return/line feed character at the end.

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 str) throws IOException
Method
 

print() prints the specified primitive datatype or String to the client followed by a carriage return/line feed character at the end. The no-argument version simply writes a carriage return/line feed.