Package com.illumon.iris.importers.util
Class FooterSkipBufferedReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
com.illumon.iris.importers.util.FooterSkipBufferedReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class FooterSkipBufferedReader extends BufferedReader
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FooterSkipBufferedReader(Reader in, int skipFooterLines)
Creates a buffered reader usingFooterSkipBufferedReader(Reader, int, int)
that will skip a specified number of rows at the end, using the default buffer size ofDEFAULT_BUFFER_SIZE
.FooterSkipBufferedReader(Reader in, int skipFooterLines, int bufferSize)
Creates a buffered reader that will skip a specified number of rows at the end, using the specified buffer size. -
Method Summary
Modifier and Type Method Description static int
getDefaultBufferSize()
Returns the default buffer size, in characters, that will be used if no size is specified when the reader is createdStream<String>
lines()
Unsupported by the FooterSkipBufferedReadervoid
mark(int readAheadLimit)
Unsupported by the FooterSkipBufferedReaderboolean
markSupported()
Tells whether this stream supports the mark() operation, which it does not.int
read()
Reads a single character up to the lines to be skipped as specified in the constructor.int
read(char[] cbuf, int off, int len)
String
readLine()
Unsupported by the FooterSkipBufferedReadervoid
reset()
Unsupported by the FooterSkipBufferedReaderlong
skip(long n)
Unsupported by the FooterSkipBufferedReader
-
Constructor Details
-
FooterSkipBufferedReader
Creates a buffered reader usingFooterSkipBufferedReader(Reader, int, int)
that will skip a specified number of rows at the end, using the default buffer size ofDEFAULT_BUFFER_SIZE
.- Parameters:
in
- The InputStreamReader from which the buffered reader will readskipFooterLines
- How many lines to skip at the end of processing
-
FooterSkipBufferedReader
Creates a buffered reader that will skip a specified number of rows at the end, using the specified buffer size.- Parameters:
in
- The InputStreamReader from which the buffered reader will readskipFooterLines
- How many lines to skip at the end of processingbufferSize
- Size in characters (ints) of the buffer to use when reading the stream; this must be at least large enough to contain the entirety of the rows to be skipped.
-
-
Method Details
-
getDefaultBufferSize
public static int getDefaultBufferSize()Returns the default buffer size, in characters, that will be used if no size is specified when the reader is created- Returns:
- int value of the DEFAULT_BUFFER_SIZE defined for the class
-
read
- Overrides:
read
in classBufferedReader
- Throws:
IOException
-
read
Reads a single character up to the lines to be skipped as specified in the constructor.- Overrides:
read
in classBufferedReader
- Returns:
- The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
- Throws:
IOException
- If an I/O error occurs
-
readLine
Unsupported by the FooterSkipBufferedReader- Overrides:
readLine
in classBufferedReader
-
skip
public long skip(long n)Unsupported by the FooterSkipBufferedReader- Overrides:
skip
in classBufferedReader
-
markSupported
public boolean markSupported()Tells whether this stream supports the mark() operation, which it does not.- Overrides:
markSupported
in classBufferedReader
-
mark
public void mark(int readAheadLimit)Unsupported by the FooterSkipBufferedReader- Overrides:
mark
in classBufferedReader
-
reset
public void reset()Unsupported by the FooterSkipBufferedReader- Overrides:
reset
in classBufferedReader
-
lines
Unsupported by the FooterSkipBufferedReader- Overrides:
lines
in classBufferedReader
-