|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.dixshtix.riff.InStream
InputStream with pushback facilities for implementing read of nested chunks.
Field Summary | |
private java.io.InputStream |
in
Wrapped InputStream. |
private boolean |
isLittleEndian
A Mark for forms with bit-reversal. |
private java.util.Stack |
stack
Stack for pushing read container Chunks. |
Fields inherited from class java.io.InputStream |
SKIP_BUFFER_SIZE, skipBuffer |
Constructor Summary | |
InStream(java.io.InputStream inpStr)
Constructor which wraps an InputStream. |
Method Summary | |
int |
available()
Under construction. |
void |
chunkAscend(IOChunk c)
After all chunk data has been read, this will close and pop the chunk. |
IOChunk |
chunkDescend()
Read a chunk header and push on stack. |
IOChunk |
chunkDescend(FourByteConstant fcc)
Given a four-byte-constant, complete reading of the chunk header and push on stack. |
boolean |
chunkEnd()
Detect end of current chunk. |
void |
close()
Close input file. |
void |
fsf(long bytes)
Forwards-space (mark off) bytes read on all open chunks. |
boolean |
isContainerType(FourByteConstant fcc)
Utility to interpret a FourByteConstant. |
boolean |
isEmpty()
Test if this is outside the Form chunk. |
void |
mark(int readlimit)
Under construction. |
boolean |
markSupported()
Under construction. |
IOChunk |
peek()
Return the currently open chunk. |
IOChunk |
pop()
Pop a chunk off the stack. |
void |
push(IOChunk chunk)
Push a chunk onto the stack. |
int |
read()
Read a single byte. |
int |
read(byte[] b)
Fill a pre-allocated buffer with read bytes. |
int |
read(byte[] b,
int off,
int len)
Read a few bytes. |
char |
readChar()
Read two bytes as a binary number. |
FourByteConstant |
readFourByteConstant()
Utility to read four bytes. |
FourByteConstant |
readFourByteConstant(byte[] buf4)
Utility to read four bytes, using preallocated buffer. |
int |
readInt()
Read four bytes as a binary number. |
long |
readLong()
Read eight bytes as a binary number. |
void |
reset()
Rewind. |
long |
skip(long n)
Skip over data bytes. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.io.InputStream in
private java.util.Stack stack
private boolean isLittleEndian
Constructor Detail |
public InStream(java.io.InputStream inpStr)
inpStr
- An InputStream positioned at the beginning of a form chunk.Method Detail |
public boolean isEmpty()
public IOChunk peek()
public IOChunk pop()
public void push(IOChunk chunk)
public void fsf(long bytes)
bytes
- The number bytes read.public int available() throws java.io.IOException
available
in class java.io.InputStream
public void close() throws java.io.IOException
close
in class java.io.InputStream
public void mark(int readlimit)
mark
in class java.io.InputStream
public boolean markSupported()
markSupported
in class java.io.InputStream
public int read() throws java.io.IOException
read
in class java.io.InputStream
public int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
public char readChar() throws java.io.IOException
public int readInt() throws java.io.IOException
public long readLong() throws java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
public long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
public FourByteConstant readFourByteConstant() throws java.io.IOException
public FourByteConstant readFourByteConstant(byte[] buf4) throws java.io.IOException
buf4
- Allocation for four bytes.public IOChunk chunkDescend() throws java.io.IOException
public IOChunk chunkDescend(FourByteConstant fcc) throws java.io.IOException
fcc
- A recently read four-byte chunk id.public boolean chunkEnd()
public void chunkAscend(IOChunk c) throws java.io.IOException
c
- The chunk to pop.public boolean isContainerType(FourByteConstant fcc)
fcc
- A recently-read chunk type.
|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |