Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Serialization vs Binary Read/Write

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mugunth - 17 Feb 2008 17:13 GMT
Is there any special advantage of using Serialization using a
BinaryFormatter over classic Read/Write using BinaryReader and
BinaryWriter?
In my case, Serialization is bloating up the output file size
drastically at least by a factor of 5. Serialization also takes more
time (probably because of the huge size) that BinaryWriter.

Can someone elucidate the differences, advantages/disadvantages of one
over another?

Regards,
Mugunth
Jesse Houwing - 17 Feb 2008 17:51 GMT
Hello Mugunth,

> Is there any special advantage of using Serialization using a
> BinaryFormatter over classic Read/Write using BinaryReader and
[quoted text clipped - 4 lines]
> Can someone elucidate the differences, advantages/disadvantages of one
> over another?

Serialization takes into account class versioning (if implemented in the
respective types), assembly names, public key tokens and such for each typereference
it encouters. This ofcourse makes the outptu larger, but also helps reading
the resulted binary back in in a later version of your application.

There are also a few serialization formatters available (for example those
used in the ASP.NET Viewstate serialization process) that are specifically
created to make the output as small as possible. You could have a look at
those. One is called the LosFormatter and there's a nice post available here:

http://rahulgangwar.spaces.live.com/blog/cns!EC27D61C72887359!137.entry

That explains it pretty well.

--
Jesse Houwing
jesse.houwing at sogeti.nl

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.