Bug? RandomAccessFile ReadObject on e.g. text file hangs, high CPU - walt61    May 18, 2022 Am I doing something wrong or is this a bug? I know I shouldn't be using ReadObject if I know the file wasn't written with WriteObject, but I want to let the user select any file they choose and then read the Map that was written to it - if there is one:
File.WriteString(File.DirApp, "test.txt" B4i Question B4X XUI ASDraw - marconotsopolo (first post)    Nov 10, 2024 OK, so resolved this by writing the file using randomaccessfile (writeb4xobject) and reading in using readb4xobject to maintain the list structure. 'Write file' Dim r As RandomAccessFile r.Initialize(File.DirDocuments,"test.lst",False) r.WriteB4XObject(ASDraw1.ExportDrawing,0) r.close 'Re B4J Question Unreadble Characters - KMatle (first post)    Apr 06, 2018   (1 reaction) Hard without seeing your code. I always use RandomAccessFile. You can write and read any object you like (lists, maps, texts, etc.). Here it is encrypted, too.
Dim raf As RandomAccessFile
raf.Initialize(MyPath, "config.dat", False)
raf.WriteEncryptedObject(MyList, "MySecretPW", raf.CurrentPosition) B4A Question B4A: java.lang.ClassCastException: java.lang.String cannot be cast to b4a.exam - Erel (first post)    Jun 08, 2017   (1 reaction) Or RandomAccessFile.WriteB4XObject / ReadB4XObject. B4J Question WriteEncryptedObject Error - kiki78    Feb 01, 2021 I receive error with RandomAccessFile WriteEncryptedObject. I previously use it in other project without problem. Dim F As RandomAccessFile F.Initialize(PathFich, NomFich, False) Dim B(FileSize) As Byte 'Some B initialization F.WriteBytes(B, 0, B.Length, 0) F.WriteEncryptedObject("A String", "M Bug? WriteEncryptedObject Error - kiki78    Feb 01, 2021 I receive error with RandomAccessFile WriteEncryptedObject. I previously use it in other project without problem. Dim F As RandomAccessFile F.Initialize(PathFich, NomFich, False) Dim B(FileSize) As Byte 'Some B initialization F.WriteBytes(B, 0, B.Length, 0) F.WriteEncryptedO B4i Question RandomAccessFile - prevent crashes - Alexander Stolte    Jul 29, 2020 Hey,
during WriteB4XObject the app crashes, so the file is maybe damaged, if I try to read the file now, the app crashes.
I put the reading in a try catch block, the problem is it doesn't prevent the app from crashing the same happens with writing.
Try
If File.Exists(TokenFolder, Tok B4A Question WriteObject Error List Object Not Initialized - Gentry    Feb 15, 2018 b4a.randomaccessfile.RandomAccessFile.writeObject(RandomAccessFile.java:486) at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.writeMap(RandomAccessFile.java:596) at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.writeType(RandomAccessFile.java:545) at anywheresoftware.b4 B4A Question AnotherDatePicker (B4X) error r/w to a Map - DonManfred (first post)    Apr 18, 2018   (1 reaction) If you do it right then it does work. Use RandomAccessFiles WriteB4XObject/ReadB4XObject Bug? RandomAccessFile.WriteObject for List have activity Obj. - xky (first post)    Dec 30, 2017 For example:
'Activity.LoadLayout("Layout1")
CL1.Initialize
lsL.Initialize
End Sub
Sub Activity_Resume
CL1.a=1
CL1.b=2
lsL.Add(CL1)
Msgbox("OK","")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub Page: 1   2   3   4   5   6   7   Powered by ColBERT |