org.ujmp.core.util.io
Class SeekableLineInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.ujmp.core.util.io.SeekableLineInputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable
public class SeekableLineInputStream extends java.io.InputStreamThis 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()
-
-
Constructor Summary
Constructors Constructor and Description SeekableLineInputStream(java.io.File file)SeekableLineInputStream(java.lang.String file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()intgetLineCount()longgetMaxLineLength()java.lang.StringgetMostProbableDelimiter()intread()java.lang.StringreadLine(int lineNumber)
-
-
-
Constructor Detail
-
SeekableLineInputStream
public SeekableLineInputStream(java.lang.String file) throws java.io.IOException- Throws:
java.io.IOException
-
SeekableLineInputStream
public SeekableLineInputStream(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
getMaxLineLength
public long getMaxLineLength()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.lang.AutoCloseable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
getLineCount
public int getLineCount()
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
getMostProbableDelimiter
public java.lang.String getMostProbableDelimiter()
-
readLine
public java.lang.String readLine(int lineNumber) throws java.io.IOException- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG