S stephankuba Member Licensed User Longtime User Jan 23, 2014 #1 Hi, is it possible to read any file into binary? (Bits) Because I want to change some bits and write it back to the file. I saw the RandomAccessFile but there is only read byte. Maybe someone has a code for this, because I don't realy understand the RandomAccessFile Library. thank you.
Hi, is it possible to read any file into binary? (Bits) Because I want to change some bits and write it back to the file. I saw the RandomAccessFile but there is only read byte. Maybe someone has a code for this, because I don't realy understand the RandomAccessFile Library. thank you.
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2014 #2 is it possible to read any file into binary? Click to expand... Yes. With RandomAccessFile you do not need to read the full file. You can read the required section, modify it and write it back. You should use raf.ReadBytes and raf.WriteBytes. Upvote 0
is it possible to read any file into binary? Click to expand... Yes. With RandomAccessFile you do not need to read the full file. You can read the required section, modify it and write it back. You should use raf.ReadBytes and raf.WriteBytes.
S stephankuba Member Licensed User Longtime User Jan 23, 2014 #3 thank you for your fast answear. I have some questin about this: Code: Copy Dim test As RandomAccessFile Dim readf() As Byte test.Initialize(File.DirRootExternal,"test.dat",False) test.ReadBytes(readf(),????,???,???) Msgbox(test,"test") I want to get the hole file in the readf() array, what parameter must I choose? thank you Upvote 0
thank you for your fast answear. I have some questin about this: Code: Copy Dim test As RandomAccessFile Dim readf() As Byte test.Initialize(File.DirRootExternal,"test.dat",False) test.ReadBytes(readf(),????,???,???) Msgbox(test,"test") I want to get the hole file in the readf() array, what parameter must I choose? thank you
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2014 #4 See the code here: http://www.b4x.com/android/forum/th...-dirassets-solution-wanted.26777/#post-154939 Upvote 0
See the code here: http://www.b4x.com/android/forum/th...-dirassets-solution-wanted.26777/#post-154939
S stephankuba Member Licensed User Longtime User Jan 23, 2014 #5 thank you erel, I will try this. Upvote 0