JakeWharton / DiskLruCache

Java implementation of a Disk-based LRU cache which specifically targets Android compatibility.
http://jakewharton.github.io/DiskLruCache
Apache License 2.0
5.79k stars 1.18k forks source link

Add getLength method to Snapshot #25

Closed scompt closed 12 years ago

scompt commented 12 years ago

This pull request adds a getLength method to the Snapshot class. This lets you fetch the length of the associated stream without having to do something crazy like read the whole this. This is useful for me in the case where I'm sending the stream to a client and I need to send a Content-Length header before the data. The tests have been updated as well.