Deserializing multiple lists

i have list that is serialized and saved to file the classic way with binary formatter and then bf.serialize(file, list) then deserialize same way bf.deserialize(file) as list.

Now, how can I serialize list2 to same file and later deserialize it to list2? Can that be achieved?

Thanks

Yup. There are a couple of ways to do this.

  • Store both lists in a class. Serialise this class.
  • Convert the binary stream to a string. Add separators or line breaks between strings in the file.

So to do it with class. Nice and how do i deserialize class. Yeah i will watch tutorial but asking :stuck_out_tongue:
And no strings as they take way much more time and size. Iam keeping it with ushort and byte :slight_smile:

There is no material difference in size between an array of bytes and a string generated from that bite array. A string is just easier to manipulate in terms of separators.

Identical to how you serialise a List. A list is a class after all.