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
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionFooterSkipBufferedReader
(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 TypeMethodDescriptionstatic int
Returns the default buffer size, in characters, that will be used if no size is specified when the reader is createdlines()
Unsupported by the FooterSkipBufferedReadervoid
mark
(int readAheadLimit) Unsupported by the FooterSkipBufferedReaderboolean
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) readLine()
Reads a line of text.void
reset()
Unsupported by the FooterSkipBufferedReaderlong
skip
(long n) Unsupported by the FooterSkipBufferedReaderMethods inherited from class java.io.BufferedReader
close, ready
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
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
Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), a carriage return followed immediately by a line feed, or by reaching the end-of-file (EOF).- Overrides:
readLine
in classBufferedReader
- Returns:
- A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached without reading any characters
- Throws:
IOException
- If an I/O error occurs- See Also:
-
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
-