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
-
bheader
- Internal buffer to hold chunk size.
-
buffer
- The chunking buffer.
-
bufptr
- Where to put next piece of data (current chunk size).
-
chunksize
- The chunk size to use (defaults to buffer size).
-
ChunkedOutputStream(byte[], DataOutputStream)
- Create a chunk encoder, using the provided buffer.
-
ChunkedOutputStream(DataOutputStream)
- Create a chunk encoder.
-
append(byte[], int, int)
- Append a bunch of bytes to current pending chunk.
-
append(int)
-
Append one byte to pending chunk.
-
close()
- Close that encoding stream.
-
flush()
- Flush pending output.
-
sendChunk()
- Send current chunk of data.
-
sendChunk(byte[], int, int)
- Send given buffer as a full chunk.
-
sendClose()
- Send the close chunk.
-
write(byte[], int, int)
- Write an array of bytes.
-
write(int)
- Write one byte of output.
buffer
protected byte buffer[]
- The chunking buffer.
bufptr
protected int bufptr
- Where to put next piece of data (current chunk size).
chunksize
protected int chunksize
- The chunk size to use (defaults to buffer size).
bheader
protected byte bheader[]
- Internal buffer to hold chunk size.
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.
ChunkedOutputStream
public ChunkedOutputStream(DataOutputStream out)
- Create a chunk encoder.
- Parameters:
- out - The DataOutputStream to write to.
sendClose
protected void sendClose() throws IOException
- Send the close chunk.
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.
sendChunk
protected void sendChunk() throws IOException
- Send current chunk of data.
- Throws: IOException
- If writing fails.
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.
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.
close
public void close() throws IOException
- Close that encoding stream.
- Throws: IOException
- If writing fails.
- Overrides:
- close in class FilterOutputStream
flush
public void flush() throws IOException
- Flush pending output.
- Throws: IOException
- If writing fails.
- Overrides:
- flush in class DataOutputStream
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
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