|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--java.io.DataOutputStream | +--org.w3c.www.http.ChunkedOutputStream
Field Summary | |
protected byte[] |
bheader
Internal buffer to hold chunk size. |
protected byte[] |
buffer
The chunking buffer. |
protected int |
bufptr
Where to put next piece of data (current chunk size). |
protected int |
chunksize
The chunk size to use (defaults to buffer size). |
Fields inherited from class java.io.DataOutputStream |
written |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
ChunkedOutputStream(byte[] buffer,
java.io.DataOutputStream out)
Create a chunk encoder, using the provided buffer. |
|
ChunkedOutputStream(java.io.DataOutputStream out)
Create a chunk encoder. |
Method Summary | |
protected void |
append(byte[] b,
int off,
int len)
Append a bunch of bytes to current pending chunk. |
protected void |
append(int v)
Append one byte to pending chunk. |
void |
close()
Close that encoding stream. |
void |
flush()
Flush pending output. |
protected void |
sendChunk()
Send current chunk of data. |
protected void |
sendChunk(byte[] b,
int off,
int len)
Send given buffer as a full chunk. |
protected void |
sendClose()
Send the close chunk. |
void |
write(byte[] b,
int off,
int len)
Write an array of bytes. |
void |
write(int b)
Write one byte of output. |
Methods inherited from class java.io.DataOutputStream |
size,
writeBoolean,
writeByte,
writeBytes,
writeChar,
writeChars,
writeDouble,
writeFloat,
writeInt,
writeLong,
writeShort,
writeUTF |
Methods inherited from class java.io.FilterOutputStream |
write |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected byte[] buffer
protected int bufptr
protected int chunksize
protected byte[] bheader
Constructor Detail |
public ChunkedOutputStream(byte[] buffer, java.io.DataOutputStream out)
buffer
- The buffer to use (determines the default chunk size).put
- The DataOutputStream to write encoded data to.public ChunkedOutputStream(java.io.DataOutputStream out)
out
- The DataOutputStream to write to.Method Detail |
protected void sendClose() throws java.io.IOException
protected void sendChunk(byte[] b, int off, int len) throws java.io.IOException
b
- The buffer that contains the data to emit.off
- Offset of chunk in above buffer.len
- Length of chunk.protected void sendChunk() throws java.io.IOException
protected final void append(int v) throws java.io.IOException
v
- The byte to append.protected final void append(byte[] b, int off, int len) throws java.io.IOException
b
- The chunk of bytes to add.off
- Offset of chunk within above buffer.len
- Length of chunk.public void close() throws java.io.IOException
public void flush() throws java.io.IOException
public void write(int b) throws java.io.IOException
v
- The byte to write.public void write(byte[] b, int off, int len) throws java.io.IOException
b
- The data to write.off
- Offfset within above buffer.len
- Length of data to write.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |