public class ChunkedMessageBodyOutputStream
extends java.io.OutputStream
Each chunk starts with the number of octets of the data it embeds, expressed as a hexadecimal numbers in ASCII and a terminating CRLF sequence, followed by the chunk data. The chunk is terminated by CRLF.
| Constructor and Description |
|---|
ChunkedMessageBodyOutputStream(java.io.OutputStream os)
Creates a new instance of
ChunkedMessageBodyOutputStream using the specified OutputStream as the
underlying OutputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this output stream.
|
void |
flush()
Writes the pending data and flush underlying stream.
|
void |
write(byte[] b,
int off,
int len)
Writes the content of the byte array
b from the offset off in length len
in chunked encoding using the underlying OutputStream. |
void |
write(int b)
Write one byte of data.
|
public ChunkedMessageBodyOutputStream(java.io.OutputStream os)
ChunkedMessageBodyOutputStream using the specified OutputStream as the
underlying OutputStream.os - the underlying OutputStream to usepublic final void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException - when an error occurs while closing the streampublic final void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - when the connection is closed.public final void write(byte[] b,
int off,
int len)
throws java.io.IOException
b from the offset off in length len
in chunked encoding using the underlying OutputStream.write in class java.io.OutputStreamb - the byte arrayoff - the starting index in byte array blen - the number of bytes written to the underlying Output stream in chunked encoding.java.io.IOException - if the ChunkedMessageBodyOutputStream is already closed.public final void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - the byte to write to the underlying OutputStreamjava.io.IOException - if the ChunkedMessageBodyOutputStream is already closed.OutputStream.write(int)