org.apache.http.impl.io
Class AbstractHttpDataReceiver

java.lang.Object
  extended by org.apache.http.impl.io.AbstractHttpDataReceiver
All Implemented Interfaces:
HttpDataReceiver
Direct Known Subclasses:
SocketHttpDataReceiver

public abstract class AbstractHttpDataReceiver
extends java.lang.Object
implements HttpDataReceiver

Abstract base class for data receivers using traditional IO.

Author:
Oleg Kalnichevski

Constructor Summary
AbstractHttpDataReceiver()
           
 
Method Summary
protected  int fillBuffer()
           
 HttpTransportMetrics getMetrics()
           
protected  boolean hasBufferedData()
           
protected  void init(java.io.InputStream instream, int buffersize, HttpParams params)
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 java.lang.String readLine()
           
 int readLine(CharArrayBuffer charbuffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.http.io.HttpDataReceiver
isDataAvailable
 

Constructor Detail

AbstractHttpDataReceiver

public AbstractHttpDataReceiver()
Method Detail

init

protected void init(java.io.InputStream instream,
                    int buffersize,
                    HttpParams params)

fillBuffer

protected int fillBuffer()
                  throws java.io.IOException
Throws:
java.io.IOException

hasBufferedData

protected boolean hasBufferedData()

read

public int read()
         throws java.io.IOException
Specified by:
read in interface HttpDataReceiver
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Specified by:
read in interface HttpDataReceiver
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Specified by:
read in interface HttpDataReceiver
Throws:
java.io.IOException

readLine

public int readLine(CharArrayBuffer charbuffer)
             throws java.io.IOException
Specified by:
readLine in interface HttpDataReceiver
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Specified by:
readLine in interface HttpDataReceiver
Throws:
java.io.IOException

getMetrics

public HttpTransportMetrics getMetrics()
Specified by:
getMetrics in interface HttpDataReceiver


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.