HTTPClient
Class ResponseHandler

java.lang.Object
  extended byHTTPClient.ResponseHandler

final class ResponseHandler
extends Object

This holds various information about an active response. Used by the StreamDemultiplexor and RespInputStream.

Since:
V0.2

Field Summary
(package private)  boolean eof
          signals that the demux has closed the response stream, and that therefore no more data can be read
(package private)  IOException exception
          this is non-null if the stream has an exception pending
(package private)  Request request
          the response class
(package private)  Response resp
          the response class
(package private)  RespInputStream stream
          the response stream
 
Constructor Summary
(package private) ResponseHandler(Response resp, Request request, StreamDemultiplexor demux)
          Creates a new handler.
 
Method Summary
(package private)  byte[] getEndBoundary(BufferedInputStream MasterStream)
          return the boundary string for this response.
(package private)  int[] getEndCompiled(BufferedInputStream MasterStream)
          return the compilation of the boundary string for this response.
(package private)  void setupBoundary(BufferedInputStream MasterStream)
          Gets the boundary string, compiles it for searching, and initializes the buffered input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

RespInputStream stream
the response stream


resp

Response resp
the response class


request

Request request
the response class


eof

boolean eof
signals that the demux has closed the response stream, and that therefore no more data can be read


exception

IOException exception
this is non-null if the stream has an exception pending

Constructor Detail

ResponseHandler

ResponseHandler(Response resp,
                Request request,
                StreamDemultiplexor demux)
Creates a new handler. This also allocates the response input stream.

Parameters:
resp - the reponse
request - the request
demux - our stream demultiplexor.
Method Detail

getEndBoundary

byte[] getEndBoundary(BufferedInputStream MasterStream)
                throws IOException,
                       ParseException
return the boundary string for this response. Set's up the InputStream buffer if neccessary.

Parameters:
MasterStream - the input stream from which the stream demux is reading.
Returns:
the boundary string.
Throws:
IOException
ParseException

getEndCompiled

int[] getEndCompiled(BufferedInputStream MasterStream)
               throws IOException,
                      ParseException
return the compilation of the boundary string for this response. Set's up the InputStream buffer if neccessary.

Parameters:
MasterStream - the input stream from which the stream demux is reading.
Returns:
the compiled boundary string.
Throws:
IOException
ParseException

setupBoundary

void setupBoundary(BufferedInputStream MasterStream)
             throws IOException,
                    ParseException
Gets the boundary string, compiles it for searching, and initializes the buffered input stream.

Throws:
IOException
ParseException