org.hsqldb.cmdline.sqltool
Class FileRecordReader
- java.lang.Object
-
- org.hsqldb.cmdline.sqltool.FileRecordReader
-
public class FileRecordReader extends java.lang.ObjectThis class does not impement or extend java.io classes/interfaces, and is not a Reader in the sense of java.io.Reader. It is a 'reader' in the sense that it provides a method that reads and return records from a text file. The unique use case here is that records are delimited with a regular expression pattern yet the file contents are read incrementally to minimize RAM usage.
-
-
Field Summary
Fields Modifier and Type Field and Description static intINITIAL_CHARBUFFER_SIZE
-
Constructor Summary
Constructors Constructor and Description FileRecordReader(java.lang.String filePath, java.lang.String recordDelimiterRegex, java.lang.String encoding)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Free up resources and close all potentially open I/O streams.java.lang.StringgetAbsolutePath()java.lang.StringgetName()java.lang.StringgetPath()booleanisOpen()static voidmain(java.lang.String[] sa)To be replaced by proper unit test classjava.lang.StringnextRecord()
-
-
-
Field Detail
-
INITIAL_CHARBUFFER_SIZE
public static final int INITIAL_CHARBUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileRecordReader
public FileRecordReader(java.lang.String filePath, java.lang.String recordDelimiterRegex, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException- Throws:
java.util.regex.PatternSyntaxExceptionjava.io.UnsupportedEncodingExceptionjava.io.FileNotFoundException
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionFree up resources and close all potentially open I/O streams.- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
-
getPath
public java.lang.String getPath()
-
getAbsolutePath
public java.lang.String getAbsolutePath()
-
isOpen
public boolean isOpen()
-
main
public static void main(java.lang.String[] sa) throws java.io.IOExceptionTo be replaced by proper unit test class- Throws:
java.io.IOException
-
nextRecord
public java.lang.String nextRecord() throws java.io.IOException- Returns:
- null if no more records in input file
- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG