I wrote my own file format and i can ?successfully? create a binary to read from, however, Even though i can generate a proper binary, i get a 'Invalid Bank Offset' exception.
Basically, even thought i get this error, i can still generate my binary correctly and and i don't know why it works.
--
bank = CreateBank(Size_T(StreamPos(stream))) 'Create a bank with the same size as the stream we wrote to
** I use streampos because it results the same as streamsize. i wrote the data first so the last pos is = to the size..
ReadBank(bank, stream, Size_T(Banksize(bank)), StreamPos(stream)) 'Write the stream to the bank
SaveBank(bank, String(container)) 'Finalize the bank to a physical binary
--
Now of course, the issue may be obvious... Arg3 in Readbank is 'Size_T(Banksize(bank))' when it should be an offset. Okay..?
My issue is that even though this is most likely incorrect, i can still generate a perfectly working binary to read from. Everything is in the correct order.. correct size etc etc. My custom file's contents are just how they should be. ....but i get an 'Invalid Bank Offset' exception? Why does this still work? Everything still get's written after the application terminates.
I really don't get it. What am i supposed to do for offset?