Package org.snpeff.fileIterator
Class SeekableBufferedReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.BufferedReader
-
- org.snpeff.fileIterator.SeekableBufferedReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public class SeekableBufferedReader extends java.io.BufferedReaderA buffered reader for a file. It allows to 'seek' and 'readLine()'- Author:
- pablocingolani
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description SeekableBufferedReader(java.lang.String fileName)SeekableBufferedReader(java.lang.String fileName, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanequals(java.lang.Object arg0)longgetFilePointer()inthashCode()voidmark(int readAheadLimit)booleanmarkSupported()voidopen(java.lang.String fileName)intread()intread(char[] buff)intread(char[] cbuf, int off, int len)intread(java.nio.CharBuffer arg0)java.lang.StringreadLine()booleanready()voidreset()voidseek(long pos)Seek to a position in the filelongskip(long n)java.lang.StringtoString()
-
-
-
Constructor Detail
-
SeekableBufferedReader
public SeekableBufferedReader(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
SeekableBufferedReader
public SeekableBufferedReader(java.lang.String fileName, int bufferSize) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.BufferedReader- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equalsin classjava.lang.Object
-
getFilePointer
public long getFilePointer()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
mark
public void mark(int readAheadLimit) throws java.io.IOException- Overrides:
markin classjava.io.BufferedReader- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.BufferedReader
-
open
public void open(java.lang.String fileName) throws java.io.IOException- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.BufferedReader- Throws:
java.io.IOException
-
read
public int read(char[] buff) throws java.io.IOException- Overrides:
readin classjava.io.Reader- Throws:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.BufferedReader- Throws:
java.io.IOException
-
read
public int read(java.nio.CharBuffer arg0) throws java.io.IOException- Specified by:
readin interfacejava.lang.Readable- Overrides:
readin classjava.io.Reader- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException- Overrides:
readLinein classjava.io.BufferedReader- Throws:
java.io.IOException
-
ready
public boolean ready() throws java.io.IOException- Overrides:
readyin classjava.io.BufferedReader- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.BufferedReader- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOExceptionSeek to a position in the file- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.BufferedReader- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-