com.monkeycoder.monkeynetwork
Class ChunkedContentDownloader

java.lang.Object
  extended by com.monkeycoder.monkeynetwork.ContentDownloader
      extended by com.monkeycoder.monkeynetwork.ChunkedContentDownloader

public class ChunkedContentDownloader
extends ContentDownloader

This ContentDownloader handles incoming data that is chunked.

This class uses monkeynetwork.ini and requires the following parameters:

Author:
David Stephens

Field Summary
 
Fields inherited from class com.monkeycoder.monkeynetwork.ContentDownloader
hhd
 
Constructor Summary
ChunkedContentDownloader(HttpHeaderData inHhd)
          Creates a new ChunkedContentDownloader.
 
Method Summary
protected  boolean download(TurboBuffer inBuffer, java.io.InputStream inStream)
          Does the actual downloading of the requested content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedContentDownloader

public ChunkedContentDownloader(HttpHeaderData inHhd)
Creates a new ChunkedContentDownloader.

Parameters:
inHhd - The header data from this request.
Method Detail

download

protected boolean download(TurboBuffer inBuffer,
                           java.io.InputStream inStream)
                    throws java.io.IOException,
                           MonkeyException
Does the actual downloading of the requested content. This version reads data from the network in a chunked data stream until the next chunk is zero bytes in length.

Specified by:
download in class ContentDownloader
Parameters:
inBuffer - The TurboBuffer into which the data will be placed.
inStream - The InputStream from which the data will be read.
Returns:
Whether or not the content has been downloaded successfully.
Throws:
java.io.IOException - If thrown by underlying code.
MonkeyException - If thrown by underlying code.