|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--org.apache.commons.httpclient.ChunkedOutputStream
Wrapper supporting the chunked transfer encoding.
ChunkedInputStream
Constructor Summary | |
ChunkedOutputStream(OutputStream stream)
Construct an output stream wrapping the given stream. |
Method Summary | |
void |
close()
Close this output stream, causing any buffered data to be flushed and any further output data to throw an IOException. |
void |
flush()
Flushes the underlying stream. |
void |
print(String s)
Writes a String to the client, without a carriage return
line feed (CRLF) character at the end. |
void |
println()
Writes a carriage return-line feed (CRLF) to the client. |
void |
println(String s)
Writes a String to the client,
followed by a carriage return-line feed (CRLF). |
void |
write(byte[] b,
int off,
int len)
Write the specified byte array. |
void |
write(int b)
Write the specified byte to our output stream. |
void |
writeClosingChunk()
Close this output stream, causing any buffered data to be flushed and any further output data to throw an IOException. |
Methods inherited from class java.io.OutputStream |
write |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public ChunkedOutputStream(OutputStream stream)
stream
- wrapped output stream. Must be non-null.Method Detail |
public void print(String s) throws IOException
String
to the client, without a carriage return
line feed (CRLF) character at the end. The platform default encoding is
used!s
- the String
to send to the client. Must be non-null.IOException
- if an input or output exception occurredpublic void println() throws IOException
IOException
- if an input or output exception occurredpublic void println(String s) throws IOException
String
to the client,
followed by a carriage return-line feed (CRLF).s
- the String to write to the clientIOException
- if an input or output exception occurredpublic void write(int b) throws IOException, IllegalStateException
write
in class OutputStream
b
- The byte to be writtenIOException
- if an input/output error occursIllegalStateException
- if stream already closedpublic void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
b
- the byte array to write outoff
- the offset within b
to start writing fromlen
- the length of data within b
to writeIOException
- when errors occur writing outputpublic void writeClosingChunk() throws IOException
IOException
- if an error occurs closing the streampublic void flush() throws IOException
flush
in class OutputStream
IOException
- If an IO problem occurs.public void close() throws IOException
close
in class OutputStream
IOException
- if an error occurs closing the stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |