getLineEnding(Reader in) Try to detect the line ending used by the passed Reader.
This will advance the reader until a line ending is found.
The reader will not be closed
Parameters: in - the "file" to test the sequence of characters used as the line ending (e.g.
final public static long estimateRecords(File f, long sampleLines) throws IOException(Code)
Tries to estimate the number of records in the given file.
This is done by reading the first sampleLines records
of the file and assuming the average size of an row in the first
lines is close to the average row in the complete file.
Returns the number of characters according to the
encoding in the specified file. For single-byte
encodings this should be identical to source.length()
For large files this might take some time!
Parameters: source - the (text) file to check Parameters: encoding - the encoding of the text file the number of characters (not bytes) in the file
Try to detect the line ending used by the passed Reader.
This will advance the reader until a line ending is found.
The reader will not be closed
Parameters: in - the "file" to test the sequence of characters used as the line ending (e.g. \n or \r\n) throws: java.io.IOException -
Read the lines of the given Reader into a Collection.
The Reader will be closed after all lines have been read.
Parameters: in - the "file" to read a Collection with all the lines in the file
Read the contents of the Reader into the provided StringBuilder.
Max. numLines lines are read.
The Reader will not be closed
Parameters: in - the Reader to be used Parameters: buffer - the StringBuilder to received the lines Parameters: numLines - the max. number of lines to be read Parameters: lineEnd - the lineEnding to be used the number of lines read