Package org.ujmp.core.util.io
Class SeekableLineInputStream
java.lang.Object
java.io.InputStream
org.ujmp.core.util.io.SeekableLineInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
This stream searches all line end characters (hex 0A) in a file. For Linux
line splitting is OK, for Windows the character hex 0D has to be eliminated
with String.trim()
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final long[]
private final long[]
private BufferedRandomAccessFile
private static final long
private long
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
MAXLINECOUNT
private static final long MAXLINECOUNT- See Also:
-
countsTotal
private final long[] countsTotal -
diffSum
private final long[] diffSum -
bufferSize
private int bufferSize -
in
-
lineEnds
-
maxLineLength
private long maxLineLength
-
-
Constructor Details
-
SeekableLineInputStream
- Throws:
IOException
-
SeekableLineInputStream
- Throws:
IOException
-
-
Method Details
-
getMaxLineLength
public long getMaxLineLength() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
getLineCount
public int getLineCount() -
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
getMostProbableDelimiter
-
readLine
- Throws:
IOException
-