com.android.volley.toolbox
Class DiskBasedCache.CacheHeader

java.lang.Object
  extended by com.android.volley.toolbox.DiskBasedCache.CacheHeader
Enclosing class:
DiskBasedCache

static class DiskBasedCache.CacheHeader
extends Object

Handles holding onto the cache headers for an entry.


Field Summary
 String etag
          ETag for cache coherence.
 String key
          The key that identifies the cache entry.
 Map<String,String> responseHeaders
          Headers from the response resulting in this cache entry.
 long serverDate
          Date of this response as reported by the server.
 long size
          The size of the data identified by this CacheHeader.
 long softTtl
          Soft TTL for this record.
 long ttl
          TTL for this record.
 
Constructor Summary
DiskBasedCache.CacheHeader(String key, Cache.Entry entry)
          Instantiates a new CacheHeader object
 
Method Summary
static DiskBasedCache.CacheHeader readHeader(InputStream is)
          Reads the header off of an InputStream and returns a CacheHeader object.
 Cache.Entry toCacheEntry(byte[] data)
          Creates a cache entry for the specified data.
 boolean writeHeader(OutputStream os)
          Writes the contents of this CacheHeader to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

public long size
The size of the data identified by this CacheHeader. (This is not serialized to disk.


key

public String key
The key that identifies the cache entry.


etag

public String etag
ETag for cache coherence.


serverDate

public long serverDate
Date of this response as reported by the server.


ttl

public long ttl
TTL for this record.


softTtl

public long softTtl
Soft TTL for this record.


responseHeaders

public Map<String,String> responseHeaders
Headers from the response resulting in this cache entry.

Constructor Detail

DiskBasedCache.CacheHeader

public DiskBasedCache.CacheHeader(String key,
                                  Cache.Entry entry)
Instantiates a new CacheHeader object

Parameters:
key - The key that identifies the cache entry
entry - The cache entry.
Method Detail

readHeader

public static DiskBasedCache.CacheHeader readHeader(InputStream is)
                                             throws IOException
Reads the header off of an InputStream and returns a CacheHeader object.

Parameters:
is - The InputStream to read from.
Throws:
IOException

toCacheEntry

public Cache.Entry toCacheEntry(byte[] data)
Creates a cache entry for the specified data.


writeHeader

public boolean writeHeader(OutputStream os)
Writes the contents of this CacheHeader to the specified OutputStream.