Class CsvParser.CsvBuffer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    CsvParser

    private static class CsvParser.CsvBuffer
    extends java.lang.Object
    implements java.io.Closeable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int begin  
      (package private) char[] buf  
      private static int BUFFER_SIZE  
      (package private) int len  
      (package private) int pos  
      private static int READ_SIZE  
      private java.io.Reader reader  
    • Constructor Summary

      Constructors 
      Constructor Description
      CsvBuffer​(java.io.Reader reader)  
      CsvBuffer​(java.lang.String data)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      private static char[] extendAndRelocate​(char[] buf, int begin)  
      private boolean fetchData()
      Reads data from the underlying reader and manages the local buffer.
      private void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buf

        char[] buf
      • len

        int len
      • begin

        int begin
      • pos

        int pos
      • reader

        private final java.io.Reader reader
    • Constructor Detail

      • CsvBuffer

        CsvBuffer​(java.io.Reader reader)
      • CsvBuffer

        CsvBuffer​(java.lang.String data)
    • Method Detail

      • fetchData

        private boolean fetchData()
                           throws java.io.IOException
        Reads data from the underlying reader and manages the local buffer.
        Returns:
        true, if data was fetched, false if the end of the stream was reached
        Throws:
        java.io.IOException - if a read error occurs
      • extendAndRelocate

        private static char[] extendAndRelocate​(char[] buf,
                                                int begin)
      • reset

        private void reset()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException