Class RandomAccessFileReader
java.lang.Object
java.io.Reader
org.gvsig.fmap.dal.store.simplereader.virtualrows.RandomAccessFileReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
- Author:
- gvSIG Team
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Charsetprotected longprotected static final intprotected static final intprotected longprotected static final intprotected RandomAccessFileprotected Reader -
Constructor Summary
ConstructorsConstructorDescriptionRandomAccessFileReader(File f, String charsetName) RandomAccessFileReader(File f, Charset charset) RandomAccessFileReader(RandomAccessFile raf, String charsetName) RandomAccessFileReader(RandomAccessFile raf, Charset charset) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()longcountLines(Predicate<String> filter, org.apache.commons.lang3.mutable.MutableInt maxLineLen, org.gvsig.tools.task.SimpleTaskStatus status) longcountLines(Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) createIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) createIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status, Function<BufferedReader, Integer> numberOfLines) createIndexOfLines(File index, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) createOrOpenIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) createOrOpenIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status, Function<BufferedReader, Integer> numberOfLines) createOrOpenIndexOfLines(File index, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) protected voidlonglonglongbooleanstatic voidintread(char[] cbuf, int off, int len) readLine()voidrewind()voidseek(long position) Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Field Details
-
FILTER_NONE
-
INDEX_HEADER_FILESIZE
protected static final int INDEX_HEADER_FILESIZE- See Also:
-
INDEX_HEADER_INDEXCREATIONCOST
protected static final int INDEX_HEADER_INDEXCREATIONCOST- See Also:
-
MAX_BUFFER_FOR_LINE
protected static final int MAX_BUFFER_FOR_LINE- See Also:
-
raf
-
reader
-
currentPosition
protected long currentPosition -
charset
-
lastModified
protected long lastModified
-
-
Constructor Details
-
RandomAccessFileReader
- Throws:
IOException
-
RandomAccessFileReader
- Throws:
IOException
-
RandomAccessFileReader
- Throws:
IOException
-
RandomAccessFileReader
- Throws:
IOException
-
-
Method Details
-
getCharset
-
read
- Specified by:
readin classReader- Throws:
IOException
-
createReader
protected void createReader() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
getFilePointer
- Throws:
IOException
-
getCurrentPosition
public long getCurrentPosition() -
rewind
- Throws:
IOException
-
seek
- Throws:
IOException
-
readLine
- Throws:
IOException
-
countLines
public long countLines(Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
countLines
public long countLines(Predicate<String> filter, org.apache.commons.lang3.mutable.MutableInt maxLineLen, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
isRecomendedTheRecreationOfTheLinesIndex
-
createOrOpenIndexOfLines
public RandomAccessFileIndex createOrOpenIndexOfLines(File index, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
createOrOpenIndexOfLines
public RandomAccessFileIndex createOrOpenIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
createOrOpenIndexOfLines
public RandomAccessFileIndex createOrOpenIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status, Function<BufferedReader, Integer> numberOfLines) throws IOException- Throws:
IOException
-
createIndexOfLines
public RandomAccessFileIndex createIndexOfLines(File index, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
createIndexOfLines
public RandomAccessFileIndex createIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status) throws IOException - Throws:
IOException
-
createIndexOfLines
public RandomAccessFileIndex createIndexOfLines(File index, boolean safe, Predicate<String> filter, org.gvsig.tools.task.SimpleTaskStatus status, Function<BufferedReader, Integer> numberOfLines) throws IOException- Throws:
IOException
-
getLastLinesIndexCreationCost
-
main
- Throws:
Exception
-