All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.http.ChunkedOutputStream

java.lang.Object
   |
   +----java.io.OutputStream
           |
           +----java.io.FilterOutputStream
                   |
                   +----java.io.DataOutputStream
                           |
                           +----w3c.www.http.ChunkedOutputStream

public class ChunkedOutputStream
extends DataOutputStream

Variable Index

 o bheader
Internal buffer to hold chunk size.
 o buffer
The chunking buffer.
 o bufptr
Where to put next piece of data (current chunk size).
 o chunksize
The chunk size to use (defaults to buffer size).

Constructor Index

 o ChunkedOutputStream(byte[], DataOutputStream)
Create a chunk encoder, using the provided buffer.
 o ChunkedOutputStream(DataOutputStream)
Create a chunk encoder.

Method Index

 o append(byte[], int, int)
Append a bunch of bytes to current pending chunk.
 o append(int)
Append one byte to pending chunk.
 o close()
Close that encoding stream.
 o flush()
Flush pending output.
 o sendChunk()
Send current chunk of data.
 o sendChunk(byte[], int, int)
Send given buffer as a full chunk.
 o sendClose()
Send the close chunk.
 o write(byte[], int, int)
Write an array of bytes.
 o write(int)
Write one byte of output.

Variables

 o buffer
 protected byte buffer[]
The chunking buffer.

 o bufptr
 protected int bufptr
Where to put next piece of data (current chunk size).

 o chunksize
 protected int chunksize
The chunk size to use (defaults to buffer size).

 o bheader
 protected byte bheader[]
Internal buffer to hold chunk size.

Constructors

 o ChunkedOutputStream
 public ChunkedOutputStream(byte buffer[],
                            DataOutputStream out)
Create a chunk encoder, using the provided buffer.

Parameters:
buffer - The buffer to use (determines the default chunk size).
put - The DataOutputStream to write encoded data to.
 o ChunkedOutputStream
 public ChunkedOutputStream(DataOutputStream out)
Create a chunk encoder.

Parameters:
out - The DataOutputStream to write to.

Methods

 o sendClose
 protected void sendClose() throws IOException
Send the close chunk.

 o sendChunk
 protected void sendChunk(byte b[],
                          int off,
                          int len) throws IOException
Send given buffer as a full chunk.

Parameters:
b - The buffer that contains the data to emit.
off - Offset of chunk in above buffer.
len - Length of chunk.
Throws: IOException
If writing fails.
 o sendChunk
 protected void sendChunk() throws IOException
Send current chunk of data.

Throws: IOException
If writing fails.
 o append
 protected final void append(int v) throws IOException
Append one byte to pending chunk.

Parameters:
v - The byte to append.
Throws: IOException
If writing fails.
 o append
 protected final void append(byte b[],
                             int off,
                             int len) throws IOException
Append a bunch of bytes to current pending chunk.

Parameters:
b - The chunk of bytes to add.
off - Offset of chunk within above buffer.
len - Length of chunk.
Throws: IOException
If writing fails.
 o close
 public void close() throws IOException
Close that encoding stream.

Throws: IOException
If writing fails.
Overrides:
close in class FilterOutputStream
 o flush
 public void flush() throws IOException
Flush pending output.

Throws: IOException
If writing fails.
Overrides:
flush in class DataOutputStream
 o write
 public void write(int b) throws IOException
Write one byte of output.

Parameters:
v - The byte to write.
Throws: IOException
If writing fails.
Overrides:
write in class DataOutputStream
 o write
 public void write(byte b[],
                   int off,
                   int len) throws IOException
Write an array of bytes.

Parameters:
b - The data to write.
off - Offfset within above buffer.
len - Length of data to write.
Throws: IOException
If writing fails.
Overrides:
write in class DataOutputStream

All Packages  Class Hierarchy  This Package  Previous  Next  Index