ChunkedOutputStreampublic class ChunkedOutputStream extends FilterOutputStream
Fields Summary |
---|
boolean | eos | static final byte[] | CRLF | static final byte[] | LAST_TOKEN |
Constructors Summary |
---|
private ChunkedOutputStream()
super(null);
| public ChunkedOutputStream(OutputStream os)
super(os);
|
Methods Summary |
---|
public void | close()
eos();
out.close();
| public void | eos()
synchronized (this) {
if (eos) return;
eos = true;
}
out.write(LAST_TOKEN);
out.flush();
| public void | write(int b)
write(new byte[] {(byte) b}, 0, 1);
| public void | write(byte[] b)
write(b, 0, b.length);
| public void | write(byte[] b, int off, int len)
if (len == 0) return;
out.write((Integer.toHexString(len)).getBytes());
out.write(CRLF);
out.write(b, off, len);
out.write(CRLF);
|
|