|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.io.Reader
|
+--org.biojava.utils.io.RandomAccessReader
RandomAccessReader extends Reader to
provide a means to create buffered Readers from
RandomAccessFiles.
| Field Summary |
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
RandomAccessReader(java.io.RandomAccessFile raf)
Creates a new RandomAccessReader wrapping the
RandomAccessFile and using a default-sized buffer
(8192 bytes). |
|
RandomAccessReader(java.io.RandomAccessFile raf,
int sz)
Creates a new RandomAccessReader wrapping the
RandomAccessFile and using a buffer of the
specified size. |
|
| Method Summary | |
void |
close()
close closes the underlying
RandomAccessFile. |
long |
getFilePointer()
getFilePointer returns the effective position of
the pointer in the underlying RandomAccessFile. |
long |
length()
length returns the length of the underlying
RandomAccessFile. |
int |
read()
read reads one byte from the underlying
RandomAccessFile. |
int |
read(char[] cbuf,
int off,
int len)
read reads from the underlying
RandomAccessFile into an array. |
void |
seek(long pos)
seek moves the pointer to the specified position. |
| Methods inherited from class java.io.Reader |
mark, markSupported, read, ready, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RandomAccessReader(java.io.RandomAccessFile raf)
throws java.io.IOException
RandomAccessReader wrapping the
RandomAccessFile and using a default-sized buffer
(8192 bytes).
raf - a RandomAccessFile to wrap.
java.io.IOException - if an error occurs.
public RandomAccessReader(java.io.RandomAccessFile raf,
int sz)
throws java.io.IOException
RandomAccessReader wrapping the
RandomAccessFile and using a buffer of the
specified size.
raf - a RandomAccessFile to wrap.sz - an int buffer size.| Method Detail |
public void close()
throws java.io.IOException
close closes the underlying
RandomAccessFile.
close in class java.io.Readerjava.io.IOException - if an error occurs.
public long length()
throws java.io.IOException
length returns the length of the underlying
RandomAccessFile.
long.
java.io.IOException - if an error occurs.
public final int read()
throws java.io.IOException
read reads one byte from the underlying
RandomAccessFile.
read in class java.io.Readerint, -1 if the end of the stream has
been reached.
java.io.IOException - if an error occurs.
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read reads from the underlying
RandomAccessFile into an array.
read in class java.io.Readercbuf - a char [] array to read into.off - an int offset in the array at which to
start storing chars.len - an int maximum number of char to read.
int number of chars read, or -1 if the
end of the stream has been reached.
java.io.IOException - if an error occurs.
public long getFilePointer()
throws java.io.IOException
getFilePointer returns the effective position of
the pointer in the underlying RandomAccessFile.
long offset.
java.io.IOException - if an error occurs.
public void seek(long pos)
throws java.io.IOException
seek moves the pointer to the specified position.
pos - a long offset.
java.io.IOException - if an error occurs.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||