Package io.jsondb.io

Class JsonReader


  • public class JsonReader
    extends java.lang.Object
    A special File Reader to read the .json DB files that ensures proper character encoding is used and the necessary File Locks are created.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonReader​(JsonDBConfig dbConfig, java.io.File collectionFile)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.lang.String readLine()
      A utility method that reads the next line and returns it.
      • Methods inherited from class java.lang.Object

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

      • JsonReader

        public JsonReader​(JsonDBConfig dbConfig,
                          java.io.File collectionFile)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • readLine

        public java.lang.String readLine()
                                  throws java.io.IOException
        A utility method that reads the next line and returns it. Since we use a BufferedReader this method may often read more than the next line to determine if the line ended.
        Returns:
        the content of the line just read
        Throws:
        java.io.IOException - if an I/O error occurs
      • close

        public void close()