|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InputReader
The InputReader is an interface that isolates the data file source type from the BinaryFile. Represents an InputStream setup, and basic read functions.
Method Summary | |
---|---|
long |
available()
Return how many bytes left to be read in the file. |
void |
close()
Closes the underlying file. |
long |
getFilePointer()
Get the index of the next character to be read |
java.lang.String |
getName()
Get the name of the source. |
long |
length()
Return the total byte length of the source. |
int |
read()
Read from the file. |
int |
read(byte[] b)
Read from the file. |
int |
read(byte[] b,
int off,
int len)
Read from the file |
byte[] |
readBytes(int howmany,
boolean allowless)
Read from the file. |
void |
seek(long pos)
Set the index of the next character to be read. |
long |
skipBytes(long n)
Skip over n bytes in the input file |
Method Detail |
---|
java.lang.String getName()
long skipBytes(long n) throws java.io.IOException
n
- the number of bytes to skip
java.io.IOException
- Any IO errors that occur in skipping
bytes in the underlying filelong getFilePointer() throws java.io.IOException
java.io.IOException
- Any IO errors that occur in accessing
the underlying filevoid seek(long pos) throws java.io.IOException
pos
- the position to seek to.
java.io.IOException
- Any IO Errors that occur in seeking the
underlying file.long length() throws java.io.IOException
java.io.IOException
- Any IO errors encountered in accessing
the filelong available() throws java.io.IOException
java.io.IOException
- Any IO errors encountered in accessing
the filevoid close() throws java.io.IOException
java.io.IOException
- Any IO errors encountered in accessing
the fileint read() throws java.io.IOException
java.io.IOException
- Any IO errors encountered in reading
from the fileint read(byte[] b, int off, int len) throws java.io.IOException
b
- The byte array to read intooff
- the first array position to read intolen
- the number of bytes to read
java.io.IOException
- Any IO errors encountered in reading
from the fileint read(byte[] b) throws java.io.IOException
b
- the byte array to read into. Equivalent to
read(b, 0, b.length)
java.io.IOException
- Any IO errors encountered in reading
from the fileRandomAccessFile.read(byte[])
byte[] readBytes(int howmany, boolean allowless) throws java.io.EOFException, FormatException
howmany
- the number of bytes to readallowless
- if we can return fewer bytes than requested
FormatException
- Any IO Exceptions, plus an
end-of-file encountered after reading some, but now
enough, bytes when allowless was false
java.io.EOFException
- Encountered an end-of-file while
allowless was false
, but NO bytes
had been read.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |