Package psiprobe.tools
Class BackwardsLineReader
- java.lang.Object
-
- psiprobe.tools.BackwardsLineReader
-
public class BackwardsLineReader extends Object
Reads lines from "backwards" InputStream. This class facilitates reading files from bottom up.This source code was kindly contributed by Kan Ogawa.
-
-
Field Summary
Fields Modifier and Type Field Description private BufferedInputStream
bis
The bis.private String
encoding
The encoding.private boolean
skipLineFeed
The skip line feed.
-
Constructor Summary
Constructors Constructor Description BackwardsLineReader(InputStream is)
Instantiates a new backwards line reader.BackwardsLineReader(InputStream is, String encoding)
Instantiates a new backwards line reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close.String
readLine()
Read line.private void
reverse(byte[] byteArray)
Reverse.
-
-
-
Field Detail
-
bis
private BufferedInputStream bis
The bis.
-
skipLineFeed
private boolean skipLineFeed
The skip line feed.
-
encoding
private String encoding
The encoding.
-
-
Constructor Detail
-
BackwardsLineReader
public BackwardsLineReader(InputStream is)
Instantiates a new backwards line reader.- Parameters:
is
- the is
-
BackwardsLineReader
public BackwardsLineReader(InputStream is, String encoding)
Instantiates a new backwards line reader.- Parameters:
is
- the isencoding
- the encoding
-
-
Method Detail
-
readLine
public String readLine() throws IOException
Read line.- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
close
public void close() throws IOException
Close.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
reverse
private void reverse(byte[] byteArray)
Reverse.- Parameters:
byteArray
- the byte array
-
-