Object or not Object, that is the question

sioconcept

Active Member
Licensed User
Longtime User
Hi,

I would like to decrypt a file . ReadEncryptedObject return a object (indeed) but WriteObject don't ...

B4X:
   Dim input As RandomAccessFile
   Dim output As RandomAccessFile
   input.Initialize(File.DirRootExternal, "from-crypt.db", True)
   output.Initialize(File.DirDefaultExternal, "normal.db", False)
   output.WriteObject(input.ReadEncryptedObject("B4Apassword", input.CurrentPosition), False, 0)
    output.Close

Log return "java.nio.BufferUnderflowException"

So, what else ?
 

keirS

Well-Known Member
Licensed User
Longtime User
My guess is that RandomAccessFile uses buffering so what you are doing will not work. You need to split it out so you read the file in and then write it. Because the buffer will not be flushed until you call the close method.
 
Upvote 0
Top