|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
com.lizardtech.djvu.IFFInputStream
public class IFFInputStream
IFF files were originally intended for audio. But is well suited for any streaming data.
Field Summary | |
---|---|
protected com.lizardtech.djvu.IFFContext |
ctx
The chunk information. |
protected java.io.DataInputStream |
input
The input stream. |
protected java.io.InputStream |
input_raw
The raw input stream. |
protected long |
offset
The offset to the current location. |
protected long |
seekto
The seekto location. |
Constructor Summary | |
---|---|
IFFInputStream()
Creates a new IFFInputStream object. |
|
IFFInputStream(DataPool dbs)
Creates a new IFFInputStream object. |
Method Summary | |
---|---|
void |
chunkClose()
Close the current chunk. |
static IFFInputStream |
createIFFInputStream(DjVuInterface ref)
Creates an instance of IFFInputStream with the options interherited from the specified reference. |
DataPool |
getBSChunk()
Retrieves a copy of the current chunk decoded with a BSInputStream into a new DataPool. |
BSInputStream |
getBSInputStream()
Retrieve a copy of the current chunk and decodes it with a BSInputStream. |
DataPool |
getDataPool()
Retrieve a copy of the current chunk as a DataPool object. |
DjVuOptions |
getDjVuOptions()
Query the DjVuOptions used by this object. |
long |
getFilePointer()
Query the current position. |
IFFInputStream |
init(DataPool dbs)
Initialize this stream. |
boolean |
isComposite()
Query if composite |
boolean |
isDjVuFile()
This may be checked after attempting to read the first chunk to find out if the octet was present. |
int |
openChunk(java.lang.StringBuffer chkid)
Get the next chunk id. |
int |
read()
Read the next byte of the current chunk. |
int |
read(byte[] buffer,
int off,
int size)
Read data from the current chunk. |
int |
ready()
Query if data is available. |
void |
setDjVuOptions(DjVuOptions options)
Set the DjVuOptions used by this object. |
long |
skip(long size)
Skip bytes. |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, read, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.DataInputStream input
protected com.lizardtech.djvu.IFFContext ctx
protected java.io.InputStream input_raw
protected long offset
protected long seekto
Constructor Detail |
---|
public IFFInputStream()
public IFFInputStream(DataPool dbs)
dbs
- the data sourceMethod Detail |
---|
public DataPool getBSChunk() throws java.io.IOException
java.io.IOException
- if an error occurspublic BSInputStream getBSInputStream() throws java.io.IOException
java.io.IOException
- if an error occurspublic void setDjVuOptions(DjVuOptions options)
setDjVuOptions
in interface DjVuInterface
options
- The DjVuOptions used by this object.public DjVuOptions getDjVuOptions()
getDjVuOptions
in interface DjVuInterface
public static IFFInputStream createIFFInputStream(DjVuInterface ref)
ref
- Object to interherit DjVuOptions from.
public DataPool getDataPool() throws java.io.IOException
java.io.IOException
- if no chunk is open, or an io error occurs.public long getFilePointer() throws java.io.IOException
java.io.IOException
- if an error occurspublic void chunkClose() throws java.io.IOException
java.io.IOException
- if an error occurspublic boolean isComposite()
public int openChunk(java.lang.StringBuffer chkid) throws java.io.IOException
chkid
- buffer to fill with id
java.io.IOException
- if an error occurspublic IFFInputStream init(DataPool dbs)
dbs
- data source
public int read(byte[] buffer, int off, int size) throws java.io.IOException
read
in class java.io.InputStream
buffer
- byte array to filloff
- offset to start fillingsize
- maximum number of bytes to read
java.io.IOException
- if an error occurspublic int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if an error occurspublic int ready()
public boolean isDjVuFile()
public long skip(long size) throws java.io.IOException
skip
in class java.io.InputStream
size
- number of bytes to skip.
java.lang.IllegalStateException
- if an error occurs
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |