Results 1 to 3 of 3

Thread: Binary serialization with backward compatibility

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Binary serialization with backward compatibility

    I'm working on a rather complex project at the moment and have been tasked with setting up the file formats for the data being saved. The requirement is that the data be serialized to a file and deserialized on different machines.

    Currently I'm relying on the built-in binary formatter to do the job. Since future releases of this project will be written for newer .Net platforms or for Mono, what's the best way to serialize this data, ensuring that future versions will still be able to deserialize it?

    I've already taken into account that newer versions' classes will have more features and whatnot. (By creating a FileInfoBasic class that has version info and other essentials as well as a field that contains a byte array with a serialized FileInfoV1 class, or a FileInfoV2 class, or a FileInfoV3 class, or a...) I'm more concerned that .Net 5.0's binary serializer won't be able to read a .Net 2.0 serialized class (or vice versa).

    XML is not an option as the data contains several large images (which are compressed using LZW) and XML tends to store large arrays of bytes in a less than ideal way (as literally a list of numbers).

    Has anybody actually written an open-source binary serializer that can keep a consistent format across platforms?
    Last edited by agent; Jun 27th, 2007 at 09:04 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width