com.monkeycoder.monkeynetwork
Class HeaderContentDownloader

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

public class HeaderContentDownloader
extends ContentDownloader

This ContentDownloader blindly accepts incoming data until the expected end of the header. The end of the header is marked by 2 consecutive linefeed characters.

Author:
David Stephens

Field Summary
 
Fields inherited from class com.monkeycoder.monkeynetwork.ContentDownloader
hhd
 
Constructor Summary
HeaderContentDownloader(HttpHeaderData inHhd)
          Creates a new HeaderContentDownloader.
 
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

HeaderContentDownloader

public HeaderContentDownloader(HttpHeaderData inHhd)
Creates a new HeaderContentDownloader.

Parameters:
inHhd - Expects null. Not used.
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 blindly waiting for 2 consecutive linefeed characters to indicate the end of the header has been reached.

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.