FileDataEndPoint
A DataEndPoint that stores measurements as JSON files on the phone.
Used by the FileDataManager. Files can be zipped and encrypted.
- Inheritance
-
- Object
- Serializable
- DataEndPoint
- FileDataEndPoint
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
FileDataEndPoint.fromJson
FileDataEndPoint
Creates a FileDataEndPoint of type DataEndPointTypes.FILE.
Properties
bufferSize
The buffer size of the raw JSON file in bytes.
All collected data is written to a JSON file until the buffer is filled, at which time the file will be zipped. There is not a single-best bufferSize value. If data are collected at high rates, a higher value will be best to minimize zip operations. If data are collected at low rates, a lower value will be best to minimize the likelihood of data loss when the app is killed or crashes. Default size is 500 KB (500 * 1000 bytes).
encrypt
Whether to encrypt the data before storing it. Default is false.
Support only one-way encryption using a public key.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
publicKey
The public key for RSA encryption of the data, used if encrypt is true.
zip
Whether to compress (zip) the data before storing it in a file. Default is true.
If zipped, the JSON file will be reduced to 1/5 of its size. For example, the 500 KB buffer typically is reduced to ~100 KB.
Methods
toJson
Return a JSON encoding of this object.
toString
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.