org.jboss.netty.handler.stream
Interface ChunkedInput

All Known Implementing Classes:
ChunkedFile, ChunkedNioFile, ChunkedNioStream, ChunkedStream

public interface ChunkedInput

A large data stream which is consumed by ChunkedWriteHandler.

Version:
$Rev: 1685 $, $Date: 2009-08-28 16:15:49 +0900 (금, 28 8 2009) $
Author:
The Netty Project (netty-dev@lists.jboss.org), Trustin Lee (tlee@redhat.com)

Method Summary
 void close()
          Releases the resources associated with the stream.
 boolean hasNextChunk()
          Returns true if and only if there is any data left in the stream.
 Object nextChunk()
          Fetches a chunked data from the stream.
 

Method Detail

hasNextChunk

boolean hasNextChunk()
                     throws Exception
Returns true if and only if there is any data left in the stream.

Throws:
Exception

nextChunk

Object nextChunk()
                 throws Exception
Fetches a chunked data from the stream. The returned chunk is usually a ChannelBuffer, but you could extend an existing implementation to convert the ChannelBuffer into a different type that your handler or encoder understands.

Returns:
the fetched chunk, which is usually ChannelBuffer. null if there is no data left in the stream.
Throws:
Exception

close

void close()
           throws Exception
Releases the resources associated with the stream.

Throws:
Exception


Copyright © 2008-2009 JBoss, by Red Hat. All Rights Reserved.