WriteEncryptedObject to SQLite's Blob error

susu

Well-Known Member
Licensed User
Longtime User
My idea is encrypt the string then write into blob. My code is:

B4X:
Dim list1 As String
Dim Buffer() As Byte
Dim raf As RandomAccessFile
list1 = "How are you doing?"

raf.Initialize3(Buffer, False)
raf.WriteEncryptedObject(list1, "this is password", raf.CurrentPosition) ' Error here

SQL1.ExecNonQuery2("INSERT INTO table1 VALUES('1', ?)",  Array As Object(Buffer) )
raf.Close

I got error: "java.lang.ArrayIndexOutOfBoundsException".
How can I fix it? Thank you.
 
Top