I am performing data conversion: list of float values into byte array (to store data as BLOB into SQLite database). As it was suggested earlier - I am trying to used approach similar to one used in KeyValueStore. But I am trying to avoid additional file operation that exist in KeyValueStore precedures when for similar type of process list values first saved to disk using jRandomAccessFile library and only after result converted to byte array and saved to SQLite database.
In jRandomAccessFile lib there is an option that would allow to use byte array instead of disk file:
But I have to specify size of byte array otherwise, if I just use definition like:
application failing while trying to write data to such 'randomaccessfile' object.
In my case I am using arrays (lists) of the same size: 10000 float values. I've tried to do just straight
math conversion: size of float in bytes * 10000... but that was not correct answer and resulting byte array
was too small. I've tested as well with disk file and size of that file was bigger than expected value. Could you lease advice what's the proper conversion procedure.
P.S. I as well found a way to apply additional compression of my data in binary format before storing it into SQLite DB - but still would like to get this issue solved.
In jRandomAccessFile lib there is an option that would allow to use byte array instead of disk file:
B4X:
Dim raf As RandomAccessFile
Dim bf(2000000) As Byte
raf.Initialize3(bf,True)
But I have to specify size of byte array otherwise, if I just use definition like:
B4X:
Dim bf() As Byte
application failing while trying to write data to such 'randomaccessfile' object.
In my case I am using arrays (lists) of the same size: 10000 float values. I've tried to do just straight
math conversion: size of float in bytes * 10000... but that was not correct answer and resulting byte array
was too small. I've tested as well with disk file and size of that file was bigger than expected value. Could you lease advice what's the proper conversion procedure.
P.S. I as well found a way to apply additional compression of my data in binary format before storing it into SQLite DB - but still would like to get this issue solved.