ice.net
Class CachedInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byice.net.CachedInputStream

public class CachedInputStream
extends InputStream


Field Summary
protected  byte[] cache
           
 
Constructor Summary
CachedInputStream(HttpURLConnection httpUrlConnection, CacheManager cacheManager, Connection connection, byte[] buffer, int offset, int length)
          Deprecated. As of 1.6.0, replaced by CachedInputStream(HttpURLConnection, CacheManager, Connection, byte[], int, int).
CachedInputStream(HttpURLConnection httpUrlConnection, CacheManager cacheManager, Connection connection, byte[] buffer, int offset, int length)
           
 
Method Summary
protected  void addCache(byte theData)
          Helper method which add the supplied data to the internal cache array.
protected  void addCache(byte[] dataIn, int dataOffset, int dataLength)
          Helper method which add the supplied data to the internal cache array.
 int available()
          Returns how many bytes are avaliable before blocking occurs.
 void close()
          Closes the Stream.
 int read()
          Reads the next byte of data from this input stream
 int read(byte[] b, int off, int len)
          Reads up to b.length bytes of data from this input stream into an array of bytes.
protected  void submitToCache()
          Submits the complete downloaded data object to the cache.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected byte[] cache
Constructor Detail

CachedInputStream

public CachedInputStream(HttpURLConnection httpUrlConnection,
                         CacheManager cacheManager,
                         Connection connection,
                         byte[] buffer,
                         int offset,
                         int length)
Deprecated. As of 1.6.0, replaced by CachedInputStream(HttpURLConnection, CacheManager, Connection, byte[], int, int).


CachedInputStream

public CachedInputStream(HttpURLConnection httpUrlConnection,
                         CacheManager cacheManager,
                         Connection connection,
                         byte[] buffer,
                         int offset,
                         int length)
Method Detail

submitToCache

protected void submitToCache()
                      throws ICEException
Submits the complete downloaded data object to the cache.

Throws:
ICEException

addCache

protected void addCache(byte[] dataIn,
                        int dataOffset,
                        int dataLength)
                 throws ICEException
Helper method which add the supplied data to the internal cache array.

Throws:
ICEException

addCache

protected void addCache(byte theData)
                 throws ICEException
Helper method which add the supplied data to the internal cache array.

Throws:
ICEException

available

public int available()
              throws IOException
Returns how many bytes are avaliable before blocking occurs.

Throws:
IOException

close

public void close()
           throws IOException
Closes the Stream.

Throws:
IOException

read

public int read()
         throws IOException
Reads the next byte of data from this input stream

Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads up to b.length bytes of data from this input stream into an array of bytes.

Throws:
IOException