|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
com.lizardtech.djvu.CachedInputStream
public class CachedInputStream
This class is an InputStream which spans some of the accessable data in a DataPool object.
| Constructor Summary | |
|---|---|
CachedInputStream()
Creates a new CachedInputStream object. |
|
| Method Summary | |
|---|---|
int |
available()
Query how much data is available without blocking. |
java.lang.Object |
clone()
Create a copy of this stream which will referes to the same DataPool |
static CachedInputStream |
createCachedInputStream(DjVuInterface ref)
Creates an instance of CachedInputStream with the options interherited from the specified reference. |
CachedInputStream |
createCachedInputStream(int size)
Create an a new CachedInputStream. |
DjVuOptions |
getDjVuOptions()
Query the DjVuOptions used by this object. |
int |
getEndOffset()
Query the end position. |
java.util.Enumeration |
getIFFChunks()
Query the enumeration of IFF chunks. |
java.lang.String |
getName()
Query the name of this stream. |
CachedInputStream |
init(DataPool buffer,
int startOffset,
int endOffset)
Initialize the stream with a data source, startOffset, and endOffset. |
CachedInputStream |
init(java.io.InputStream input)
Initialize the stream by copying the supplied input. |
CachedInputStream |
init(java.net.URL url,
boolean prefetch)
Initialize the stream with a data source, startOffset, and endOffset. |
boolean |
isDjVuFile()
Test if the underlying file has a DjVu octet signature. |
void |
mark(int readLimit)
Marks the current location for a reset() later. |
boolean |
markSuppoted()
Query if mark is supported. |
void |
prefetchWait()
Prefetch data in the same thread. |
int |
read()
Read the next byte of data ranged 0 to 255. |
int |
read(byte[] b)
Read data into an array of bytes. |
int |
read(byte[] b,
int off,
int len)
Read data into an array of bytes. |
int |
read16()
Read the next two bytes as a posative integer. |
int |
read24()
Read the next three bytes as a posative integer. |
java.lang.String |
readFullyUTF()
Convert the accessable data into a string. |
java.lang.String |
readSizedUTF(int textsize)
Convert the accessable data into a string. |
void |
reset()
Restore the marked position |
void |
setDjVuOptions(DjVuOptions options)
Set the DjVuOptions used by this object. |
void |
setName(java.lang.String name)
Set the name of this stream. |
void |
setSize(int size)
Set the maximum number of bytes left in this stream. |
long |
skip(long n)
Skip bytes without reading. |
| Methods inherited from class java.io.InputStream |
|---|
close, markSupported |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachedInputStream()
| Method Detail |
|---|
public static CachedInputStream createCachedInputStream(DjVuInterface ref)
ref - Object to interherit DjVuOptions from.
public void setDjVuOptions(DjVuOptions options)
setDjVuOptions in interface DjVuInterfaceoptions - The DjVuOptions used by this object.public DjVuOptions getDjVuOptions()
getDjVuOptions in interface DjVuInterfacepublic CachedInputStream createCachedInputStream(int size)
size - the maximum amount of data to read from this stream
public CachedInputStream init(DataPool buffer,
int startOffset,
int endOffset)
buffer - DataPool containing data.startOffset - Starting position of this stream.endOffset - Ending position of this stream.
public CachedInputStream init(java.net.URL url,
boolean prefetch)
url - URL to read.prefetch - True if data should be prefetched. (Temporarily broken)
public CachedInputStream init(java.io.InputStream input)
input - InputStream to copy
public java.lang.Object clone()
clone in class java.lang.Objectpublic int getEndOffset()
public void setSize(int size)
size - the new sizepublic int available()
available in class java.io.InputStreampublic void mark(int readLimit)
mark in class java.io.InputStreamreadLimit - ignoredpublic boolean markSuppoted()
public int read()
read in class java.io.InputStream
public int read(byte[] b,
int off,
int len)
read in class java.io.InputStreamb - byte array to copy data tooff - byte array offset to start copying tolen - maximum number of bytes to copy
public int read(byte[] b)
read in class java.io.InputStreamb - byte array to copy data to
public int read16()
public int read24()
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOException - if an error occurspublic long skip(long n)
skip in class java.io.InputStreamn - number of bytes to skip
public void prefetchWait()
public java.lang.String readSizedUTF(int textsize)
throws java.io.IOException
textsize - maximum amount of data to read
java.io.IOException - if an error occurs
public java.lang.String readFullyUTF()
throws java.io.IOException
java.io.IOException - if an error occurspublic java.lang.String getName()
public void setName(java.lang.String name)
name - the stream namepublic boolean isDjVuFile()
public java.util.Enumeration getIFFChunks()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||