org.ujmp.core.util.io
Class SeekableLineInputStream
java.lang.Object
java.io.InputStream
org.ujmp.core.util.io.SeekableLineInputStream
- All Implemented Interfaces:
- Closeable
public class SeekableLineInputStream
- extends InputStream
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()
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SeekableLineInputStream
public SeekableLineInputStream(String file)
throws IOException
- Throws:
IOException
SeekableLineInputStream
public SeekableLineInputStream(File file)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
getLineCount
public int getLineCount()
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
readLine
public String readLine(int lineNumber)
throws IOException
- Throws:
IOException
Copyright © 2010. All Rights Reserved.