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
  • Constructor Details

    • FooterSkipBufferedReader

      public FooterSkipBufferedReader​(@NotNull Reader in, int skipFooterLines)
      Creates a buffered reader using FooterSkipBufferedReader(Reader, int, int) that will skip a specified number of rows at the end, using the default buffer size of DEFAULT_BUFFER_SIZE.
      Parameters:
      in - The InputStreamReader from which the buffered reader will read
      skipFooterLines - How many lines to skip at the end of processing
    • FooterSkipBufferedReader

      public FooterSkipBufferedReader​(@NotNull 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.
      Parameters:
      in - The InputStreamReader from which the buffered reader will read
      skipFooterLines - How many lines to skip at the end of processing
      bufferSize - 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

      public int read​(@NotNull char[] cbuf, int off, int len) throws IOException
      Overrides:
      read in class BufferedReader
      Throws:
      IOException
    • read

      public int read() throws IOException
      Reads a single character up to the lines to be skipped as specified in the constructor.
      Overrides:
      read in class BufferedReader
      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

      public String readLine()
      Unsupported by the FooterSkipBufferedReader
      Overrides:
      readLine in class BufferedReader
    • skip

      public long skip​(long n)
      Unsupported by the FooterSkipBufferedReader
      Overrides:
      skip in class BufferedReader
    • markSupported

      public boolean markSupported()
      Tells whether this stream supports the mark() operation, which it does not.
      Overrides:
      markSupported in class BufferedReader
    • mark

      public void mark​(int readAheadLimit)
      Unsupported by the FooterSkipBufferedReader
      Overrides:
      mark in class BufferedReader
    • reset

      public void reset()
      Unsupported by the FooterSkipBufferedReader
      Overrides:
      reset in class BufferedReader
    • lines

      public Stream<String> lines()
      Unsupported by the FooterSkipBufferedReader
      Overrides:
      lines in class BufferedReader