Say I have a string, a byte[] and an ArrayList containing a custom class, let's call it MyClass. I need to store all 3 of those in the same file, possibly multiple times, and I thought of doing so by converting everything into a byte array and storing it. The string is pretty straight forward: convert into byte[] and write to file, same thing with the byte array and I can also convert the ArrayList into a byte[] or a bunch of byte[] and write them to the file. Say I have a string, a byte[] and an ArrayList