APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.httpserver

pack-priv Class ChunkedOutputStream

extends FilterOutputStream
Class Inheritance
Imports
java.io.*, java.util.Objects

a class which allows the caller to write an arbitrary number of bytes to an underlying stream. normal close() does not close the underlying stream This class is buffered. Each chunk is written in one go as :- abcd\r\nxxxxxxxxxxxxxx\r\n abcd is the chunk-size, and xxx is the chunk data If the length is less than 4 chars (in size) then the buffer is written with an offset. Final chunk is: 0\r\n\r\n

Field Summary

Modifier and TypeField and Description
private byte[]
pack-priv static final int
private boolean
private int
pack-priv static final int
private int
pack-priv ExchangeImpl
t

Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.

public void
flush()

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

public void
write(int b)

Overrides java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

public void
write(byte[] b, int off, int len)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

private void
writeChunk()

write out a chunk , and reset the pointers chunk does not have to be CHUNK_SIZE bytes count must == number of user bytes (<= CHUNK_SIZE)

Inherited from java.io.FilterOutputStream:
write

Field Detail

bufback to summary
private byte[] buf
CHUNK_SIZEback to summary
pack-priv static final int CHUNK_SIZE
closedback to summary
private boolean closed

Hides java.io.FilterOutputStream.closed.

countback to summary
private int count
OFFSETback to summary
pack-priv static final int OFFSET
posback to summary
private int pos
tback to summary
pack-priv ExchangeImpl t

Constructor Detail

ChunkedOutputStreamback to summary
pack-priv ChunkedOutputStream(ExchangeImpl t, OutputStream src)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Exceptions
IOException:
if an I/O error occurs.
flushback to summary
public void flush() throws IOException

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.FilterOutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(int b) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

The write method of FilterOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Exceptions
IOException:
if an I/O error occurs.
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Exceptions
IOException:
if an I/O error occurs.
writeChunkback to summary
private void writeChunk() throws IOException

write out a chunk , and reset the pointers chunk does not have to be CHUNK_SIZE bytes count must == number of user bytes (<= CHUNK_SIZE)