This is the library for serializing/deserializing as well as compressing/decompressing the Cyface binary format.
-
Create a CyfaceDataProcessor object for each cyface binary you want to process as
InputStreamand tell the processor, if the source binary iscompressed. Two implemenations for either in-memory or filesystem processing are available for usage:CyfaceDataProcessor proc = new CyfaceDataProcessorOnDiskImpl(binInputStream, compressed);CyfaceDataProcessor proc = new CyfaceDataProcessorInMemoryImpl(binInputStream, compressed);
-
Let the CyfaceDataProcessor uncompress and prepare the binary source for later data readout
proc.uncompressAndPrepare(); -
Read out data. Each step is optional
- Read out header info with further readout options for instance for format version and number of data points for each sensor
CyfaceBinaryHeader header = proc.getHeader(); - Read out sensor data. Poll methods will return
nullif no further point is available for a specific sensor. Check point typesLocationPointandPoint3Dfor specific value read out options.LocationPoint locPoint = proc.pollNextLocationPoint();Point3D accPoint = proc.pollNextAccelerationPoint();Point3D rotPoint = proc.pollNextRotationPoint();Point3D dirPoint = proc.pollNextDirectionPoint();Hint: Point3D.toString() prints out human readable sensor values.
- Read out header info with further readout options for instance for format version and number of data points for each sensor
-
After complete read out, don't forget to close the processor to release resources!
proc.close();