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.BufferedReader
A buffered reader for a file. It allows to 'seek' and 'readLine()'- Author:
- pablocingolani
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_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 void
close()
boolean
equals(java.lang.Object arg0)
long
getFilePointer()
int
hashCode()
void
mark(int readAheadLimit)
boolean
markSupported()
void
open(java.lang.String fileName)
int
read()
int
read(char[] buff)
int
read(char[] cbuf, int off, int len)
int
read(java.nio.CharBuffer arg0)
java.lang.String
readLine()
boolean
ready()
void
reset()
void
seek(long pos)
Seek to a position in the filelong
skip(long n)
java.lang.String
toString()
-
-
-
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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object arg0)
- Overrides:
equals
in classjava.lang.Object
-
getFilePointer
public long getFilePointer()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
mark
public void mark(int readAheadLimit) throws java.io.IOException
- Overrides:
mark
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in 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:
read
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
read
public int read(char[] buff) throws java.io.IOException
- Overrides:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
read
public int read(java.nio.CharBuffer arg0) throws java.io.IOException
- Specified by:
read
in interfacejava.lang.Readable
- Overrides:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException
- Overrides:
readLine
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
ready
public boolean ready() throws java.io.IOException
- Overrides:
ready
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
seek
public void seek(long pos) throws java.io.IOException
Seek to a position in the file- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-