Package io.jsondb.io
Class JsonReader
- java.lang.Object
-
- io.jsondb.io.JsonReader
-
public class JsonReader extends java.lang.ObjectA 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 voidclose()java.lang.StringreadLine()A utility method that reads the next line and returns it.
-
-
-
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.IOExceptionA 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()
-
-