Package aQute.lib.io
Class LineSeparatorBufferedReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.BufferedReader
-
- aQute.lib.io.LineSeparatorBufferedReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Readable
public class LineSeparatorBufferedReader extends java.io.BufferedReader
BufferedReader which returns the line separator string for the previously read line.
-
-
Constructor Summary
Constructors Constructor Description LineSeparatorBufferedReader(java.io.Reader in)
LineSeparatorBufferedReader(java.io.Reader in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
lineSeparator()
Return the line separator string from the previously read line usingreadLine()
or the empty string if end of file.void
mark(int readAheadLimit)
int
read()
int
read(char[] cbuf)
int
read(char[] cbuf, int off, int len)
int
read(java.nio.CharBuffer target)
java.lang.String
readLine()
boolean
ready()
void
reset()
long
skip(long n)
-
-
-
Method Detail
-
mark
public void mark(int readAheadLimit) throws java.io.IOException
- Overrides:
mark
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
read
public int read(java.nio.CharBuffer target) throws java.io.IOException
- Specified by:
read
in interfacejava.lang.Readable
- Overrides:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
read
public int read(char[] cbuf) throws java.io.IOException
- Overrides:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
readLine
public java.lang.String readLine() throws java.io.IOException
- Overrides:
readLine
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
ready
public boolean ready() throws java.io.IOException
- Overrides:
ready
in classjava.io.BufferedReader
- Throws:
java.io.IOException
-
lineSeparator
public java.lang.String lineSeparator() throws java.io.IOException
Return the line separator string from the previously read line usingreadLine()
or the empty string if end of file. This method can be called once per read line. Subsequent calls per read line will return the empty string.- Returns:
- The line separator string from the previously read line.
- Throws:
java.io.IOException
- If an exception occurs reading.
-
-