com.noelios.restlet.http
Class ChunkedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.noelios.restlet.http.ChunkedOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class ChunkedOutputStream
extends java.io.OutputStream

OutputStream to write data in the HTTP chunked encoding format to a destination OutputStream. See section 3.6.1 of HTTP Protocol for more information on chunked encoding.

Author:
Kevin Conaway
See Also:
HTTP/1.1 Protocol

Constructor Summary
ChunkedOutputStream(java.io.OutputStream destination)
          Convenience constructor to use a default chunk size size of 2048.
ChunkedOutputStream(java.io.OutputStream destination, int chunkSize)
           
 
Method Summary
 void close()
          Closes this output stream for writing but does not close the wrapped stream.
 void flush()
          Writes the current chunk and flushes the wrapped stream.
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write, 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 destination)
Convenience constructor to use a default chunk size size of 2048.

Parameters:
destination -
See Also:
ChunkedOutputStream(OutputStream, int)

ChunkedOutputStream

public ChunkedOutputStream(java.io.OutputStream destination,
                           int chunkSize)
Parameters:
destination - Outputstream to write chunked data to
chunkSize - Chunk size
Method Detail

close

public void close()
           throws java.io.IOException
Closes this output stream for writing but does not close the wrapped stream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Writes the current chunk and flushes the wrapped stream.

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException


Copyright © 2005-2008 Noelios Technologies.