|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lizardtech.djvu.DjVuObject
com.lizardtech.djvu.DataPool
public class DataPool
This class implements a random access mapping of input streams and URL connections. For input streams and non-http connections, the mapping is achieved by reading in all the data into memory. Http streams are mapped by reading in data blocks when needed.
| Field Summary | |
|---|---|
static int |
BLOCKSIZE
The default size of each block. |
static java.util.Hashtable |
cache
Object for caching raw data. |
| Fields inherited from class com.lizardtech.djvu.DjVuObject |
|---|
hasReferences |
| Constructor Summary | |
|---|---|
DataPool()
Creates a new DataPool object. |
|
| Method Summary | |
|---|---|
static DataPool |
createDataPool(DjVuInterface ref)
Creates an instance of DataPool with the options interherited from the specified reference. |
byte[] |
getBlock(int index,
boolean read)
Request the specified block of data. |
int |
getCurrentSize()
Query the largest read end offset. |
int |
getEndOffset()
Query the size of this vector. |
DataPool |
init(java.io.InputStream input)
Initialize this map to read the specified stream |
DataPool |
init(java.net.URL url)
Initialize this map to read the specified URL. |
protected void |
setEndOffset(int offset)
Set the end position. |
| Methods inherited from class com.lizardtech.djvu.DjVuObject |
|---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, logError, printStackTrace, setDjVuOptions, verbose |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BLOCKSIZE
public static java.util.Hashtable cache
| Constructor Detail |
|---|
public DataPool()
| Method Detail |
|---|
public static DataPool createDataPool(DjVuInterface ref)
ref - Object to interherit DjVuOptions from.
public DataPool init(java.net.URL url)
url - the URL to read
public DataPool init(java.io.InputStream input)
input - the InputStream to read
public int getCurrentSize()
public byte[] getBlock(int index,
boolean read)
index - the position of the block start position divided by BLOCKSIZE.read - True if unavailable blocks should be read from the data source.
protected void setEndOffset(int offset)
offset - new end offsetpublic int getEndOffset()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||