Class sun.server.http.HttpOutputStream
All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.http.HttpOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----java.servlet.ServletOutputStream
|
+----sun.server.http.HttpOutputStream
- public class HttpOutputStream
- extends ServletOutputStream
A buffered output stream for writing HTTP server responses.
-
buf
- The buffer where output data is stored.
-
chunking
- Whether we are doing HTTP/1.1 chunking or not.
-
chunkOut
- If we are doing chunking, delegate to this stream.
-
count
- The number of bytes in the buffer.
-
out
- The socket output stream.
-
written
- Total number of bytes written so far.
-
HttpOutputStream()
- Creates a new output stream with a default buffer size.
-
HttpOutputStream(int)
- Creates a new output stream with the specified buffer size.
-
close()
- Closes the output stream.
-
flush()
- Flushes the output stream.
-
print(int)
- Prints an integer.
-
print(long)
- Prints a long.
-
print(String)
- Prints an ASCII string.
-
println()
- Prints CRLF.
-
println(int)
- Prints an integer followed by CRLF.
-
println(long)
-
Prints an long followed by CRLF.
-
println(String)
- Prints an ASCII string followed by CRLF.
-
reset(OutputStream)
- Resets the output stream for a new connection.
-
size()
- Returns the number of bytes written so far.
-
startChunking()
- Use HTTP/1.1 chunking for output.
-
write(byte[], int, int)
- Writes an array of bytes to the output stream.
-
write(int)
- Writes a byte of data to the output stream.
out
protected OutputStream out
- The socket output stream.
buf
protected byte buf[]
- The buffer where output data is stored.
count
protected int count
- The number of bytes in the buffer.
written
protected int written
- Total number of bytes written so far.
chunking
protected boolean chunking
- Whether we are doing HTTP/1.1 chunking or not.
chunkOut
protected ChunkedOutputStream chunkOut
- If we are doing chunking, delegate to this stream.
HttpOutputStream
public HttpOutputStream(int size)
- Creates a new output stream with the specified buffer size.
- Parameters:
- size - the output buffer size
HttpOutputStream
public HttpOutputStream()
- Creates a new output stream with a default buffer size.
reset
public void reset(OutputStream out)
- Resets the output stream for a new connection.
- Parameters:
- out - the socket output stream
startChunking
public void startChunking()
- Use HTTP/1.1 chunking for output.
size
public int size()
- Returns the number of bytes written so far.
write
public void write(int b) throws IOException
- Writes a byte of data to the output stream. This method will block
until the byte is actually written.
- Parameters:
- b - the byte to be written
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- write in class OutputStream
write
public void write(byte b[],
int off,
int len) throws IOException
- Writes an array of bytes to the output stream. This method will
block until all the bytes have been written.
- Parameters:
- b - the data to be written
- off - the start offset of the data
- len - the number of bytes to written
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- write in class OutputStream
flush
public void flush() throws IOException
- Flushes the output stream.
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- flush in class OutputStream
print
public void print(String s) throws IOException
- Prints an ASCII string.
- Parameters:
- s - the string to be printed
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- print in class ServletOutputStream
print
public void print(int i) throws IOException
- Prints an integer.
- Parameters:
- i - the integer to be printed
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- print in class ServletOutputStream
print
public void print(long l) throws IOException
- Prints a long.
- Parameters:
- l - the long to be printed
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- print in class ServletOutputStream
println
public void println(String s) throws IOException
- Prints an ASCII string followed by CRLF.
- Parameters:
- s - the string to be printed
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- println in class ServletOutputStream
println
public void println(int i) throws IOException
- Prints an integer followed by CRLF.
- Parameters:
- i - the integer to be printed.
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- println in class ServletOutputStream
println
public void println(long l) throws IOException
- Prints an long followed by CRLF.
- Parameters:
- i - the long to be printed.
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- println in class ServletOutputStream
println
public void println() throws IOException
- Prints CRLF.
- Throws: IOException
- If an I/O error has occurred.
- Overrides:
- println in class ServletOutputStream
close
public void close()
- Closes the output stream.
- Overrides:
- close in class OutputStream
All Packages Class Hierarchy This Package Previous Next Index