I use the following code to read and write a custom type to file. I keep seeing this random error when attempting to read the file.
java.io.EOFException: Unexpected end of ZLIB input stream
Am I missing something when writing?
java.io.EOFException: Unexpected end of ZLIB input stream
Am I missing something when writing?
Writing:
Dim b As B4XSerializator
Dim OutBytes() As Byte = b.ConvertObjectToBytes(objData)
If OutBytes.Length = 0 Then Return 'INVALID
File.WriteBytes(strDir, strFilename, OutBytes)
Reading:
Dim b As B4XSerializator
Dim objData As Object
Dim bytes() As Byte = File.ReadBytes(strDir, strFilename)
Dim objData As Object = b.ConvertBytesToObject(bytes)