S sorex Expert Licensed User Longtime User Sep 5, 2017 #1 What is the reason that the reading of such object doesn't work straight out of the assets folder when using read only mode only ? Instead of an access denied it spits out a file not found error.
What is the reason that the reading of such object doesn't work straight out of the assets folder when using read only mode only ? Instead of an access denied it spits out a file not found error.
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #2 I've changed the thread prefix to question. RandomAccessFile object cannot work with asset files as they are actually zipped inside the APK. Use B4XSerializator instead. It will work with the assets folder. File to bytes: https://www.b4x.com/android/forum/threads/70111/#content Upvote 0
I've changed the thread prefix to question. RandomAccessFile object cannot work with asset files as they are actually zipped inside the APK. Use B4XSerializator instead. It will work with the assets folder. File to bytes: https://www.b4x.com/android/forum/threads/70111/#content
S sorex Expert Licensed User Longtime User Sep 5, 2017 #3 well, my B4J based level editor stores levelfiles as a B4XObject based file. does this serializer support full maps aswell? Edit: with the copy trick to dirinternal it (B4XObject read) works fine tho Upvote 0
well, my B4J based level editor stores levelfiles as a B4XObject based file. does this serializer support full maps aswell? Edit: with the copy trick to dirinternal it (B4XObject read) works fine tho
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #4 raf.WriteB4XObject / ReadB4XObject is based on B4XSerializator. Upvote 0
S sorex Expert Licensed User Longtime User Sep 5, 2017 #5 Well that's what I'm using now but I need to copy it first or it won't work. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #6 sorex said: Well that's what I'm using now but I need to copy it first or it won't work. Click to expand... That's expected as RandomAccessFile doesn't work with assets files. Upvote 0
sorex said: Well that's what I'm using now but I need to copy it first or it won't work. Click to expand... That's expected as RandomAccessFile doesn't work with assets files.
S sorex Expert Licensed User Longtime User Sep 5, 2017 #7 Erel said: Use B4XSerializator instead. It will work with the assets folder. raf.WriteB4XObject / ReadB4XObject is based on B4XSerializator. Click to expand... then there is a contradiction in these quotes, not? Upvote 0
Erel said: Use B4XSerializator instead. It will work with the assets folder. raf.WriteB4XObject / ReadB4XObject is based on B4XSerializator. Click to expand... then there is a contradiction in these quotes, not?
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #8 No. It was an answer to this question: sorex said: does this serializer support full maps aswell? Click to expand... Yes. B4XSerializator can do everything that RAF.ReadB4XObject can do. Anyway the answer to your question was given in post #2. Upvote 0
No. It was an answer to this question: sorex said: does this serializer support full maps aswell? Click to expand... Yes. B4XSerializator can do everything that RAF.ReadB4XObject can do. Anyway the answer to your question was given in post #2.
S sorex Expert Licensed User Longtime User Sep 5, 2017 #9 ok, now I get it. I thought you meant B4XO was based on the serializer so it should fail in both case but it's an additional class. working with a pre-load into a buffer and then using ra.initialize3 makes it work straight out of the assets. thanks for the hint! Upvote 0
ok, now I get it. I thought you meant B4XO was based on the serializer so it should fail in both case but it's an additional class. working with a pre-load into a buffer and then using ra.initialize3 makes it work straight out of the assets. thanks for the hint!