I wanted to try learning how to create a custom chunk-based binary file. I wrote a small tree structure that implements chunk hierarchy in my documentation:
As I started to work on this, I noticed that I can’t come up with a good way to write chunks into byte arrays, then output the byte arrays using DataOutputStream.
I do know that chunk-based binary files contains chunk headers that can be used as indexes in a book. You skip parts of the file until you reach the chunk you wanted, and read in the data from there.
Can the experts teach me how to write chunk-based binary files using DataOutputStream? Thanks in advance.