public interface JsonDataListener
Convenient for handling JSON content that are larger than physical memory. In this case the client should clear the log instance at fixed intervals:
class DataListener implements JsonDataListener { @Override public void dataRead(JsonLog log) { // Process log data : // Clear curve data to save memory log.clearCurves(); // Continue the process return true; } }
Modifier and Type | Method and Description |
---|---|
boolean |
dataRead(JsonLog log)
A notification from
JsonReader indicating that a new
portion of data has been read into the specified JSON file. |
boolean dataRead(JsonLog log)
JsonReader
indicating that a new
portion of data has been read into the specified JSON file.
After the client has processed the data, it may clean the curve data
in order to save memory storage. See JsonLog.clearCurves()
.
It is also possible for the client to abort the reading process at this time, by returning false from the method. This will close all resources and throw an InterruptedException back to the client.
log
- Log that has been populated with new data. Never null.JsonReader.read(boolean,boolean,JsonDataListener)
Copyright © 2024 Petroware AS - https://petroware.no