Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.http
Class ChunkingOutputStream  view ChunkingOutputStream download ChunkingOutputStream.java

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.mortbay.util.ByteBufferOutputStream
          extended byorg.mortbay.http.BufferedOutputStream
              extended byorg.mortbay.http.ChunkingOutputStream
All Implemented Interfaces:
HttpMessage.HeaderWriter

public class ChunkingOutputStream
extends BufferedOutputStream
implements HttpMessage.HeaderWriter

HTTP Chunking OutputStream.

Version:
$Id: ChunkingOutputStream.java,v 1.3 2003/04/24 23:56:12 bretts Exp $

Field Summary
(package private) static byte[] __CHUNK_EOF
           
(package private) static int __CHUNK_RESERVE
           
(package private) static byte[] __CRLF
           
(package private) static int __EOF_RESERVE
           
private  boolean _complete
           
private  boolean _completed
           
private  HttpFields _trailer
           
 
Fields inherited from class org.mortbay.http.BufferedOutputStream
_httpMessageWriter, _out
 
Fields inherited from class org.mortbay.util.ByteBufferOutputStream
_buf
 
Constructor Summary
ChunkingOutputStream(java.io.OutputStream outputStream, int bufferSize, int headerReserve)
          Constructor.
 
Method Summary
protected  void bypassWrite(byte[] b, int offset, int length)
           
 void close()
          This method closes the stream.
 void flush()
          Flush.
 void resetStream()
           
 void setTrailer(HttpFields trailer)
          Set the trailer to send with a chunked close.
protected  void wrapBuffer()
          Wrap Buffer.
 
Methods inherited from class org.mortbay.http.BufferedOutputStream
destroy, getBypassBuffer, getCommitObserver, getOutputStream, isCommitted, setBypassBuffer, setCommitObserver, write, write, writeHeader
 
Methods inherited from class org.mortbay.util.ByteBufferOutputStream
bufferSize, capacity, ensureCapacity, ensureReserve, ensureSize, ensureSize, ensureSpareCapacity, isFixed, postReserve, postwrite, preReserve, prewrite, prewrite, prewrite, reset, setFixed, size, spareCapacity, write, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mortbay.http.HttpMessage.HeaderWriter
writeHeader
 

Field Detail

__CRLF

static final byte[] __CRLF

__CHUNK_EOF

static final byte[] __CHUNK_EOF

__CHUNK_RESERVE

static final int __CHUNK_RESERVE
See Also:
Constant Field Values

__EOF_RESERVE

static final int __EOF_RESERVE
See Also:
Constant Field Values

_trailer

private HttpFields _trailer

_complete

private boolean _complete

_completed

private boolean _completed
Constructor Detail

ChunkingOutputStream

public ChunkingOutputStream(java.io.OutputStream outputStream,
                            int bufferSize,
                            int headerReserve)
Constructor.

Method Detail

setTrailer

public void setTrailer(HttpFields trailer)
Set the trailer to send with a chunked close.


flush

public void flush()
           throws java.io.IOException
Flush.

Overrides:
flush in class BufferedOutputStream

close

public void close()
           throws java.io.IOException
Description copied from class: java.io.OutputStream
This method closes the stream. Any internal or native resources associated with this stream are freed. Any subsequent attempt to access the stream might throw an exception.

This method in this class does nothing.

Overrides:
close in class BufferedOutputStream

resetStream

public void resetStream()
Overrides:
resetStream in class BufferedOutputStream

wrapBuffer

protected void wrapBuffer()
                   throws java.io.IOException
Description copied from class: BufferedOutputStream
Wrap Buffer. Called by flush() to allow the data in the buffer to be pre and post written for any protocol wrapping. The default implementation does nothing.

Overrides:
wrapBuffer in class BufferedOutputStream

bypassWrite

protected void bypassWrite(byte[] b,
                           int offset,
                           int length)
                    throws java.io.IOException
Overrides:
bypassWrite in class BufferedOutputStream