de.unkrig.commons.net.http.io
Class ChunkedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by de.unkrig.commons.net.http.io.ChunkedOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class ChunkedOutputStream
extends java.io.FilterOutputStream

Implementation of the "chunked transfer encoding" as defined in RFC 2616, Section 3.6.1.

Does not write any "chunk extensions" (because the RFC does not define any concrete chunk extensions).


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ChunkedOutputStream(java.io.OutputStream out)
           
 
Method Summary
 void addHeader(java.lang.String name, java.lang.String value)
          Appends one message header to the trailer.
 void close()
           
 void flush()
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
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
 

Constructor Detail

ChunkedOutputStream

public ChunkedOutputStream(java.io.OutputStream out)
Method Detail

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.FilterOutputStream

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Appends one message header to the trailer.


close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException