Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2009, 01:42 PM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up BinaryFormatter Problems

Hi there. I'm not used to asking for help because I normally work it all out for myself but I'm temporarily stuck and before I decide to go down a different route, I thought I'd ask if anyone's got any ideas. Part of my project involves an in-memory catalogue. It used to be quite small (when binary serialized only 2MB), but due to some bugs, we've (at least temporarily) increased its size because re-using some of the objects produced undesirable results. The problem is this. Because of its size, persisting to the database in the usual ways stopped being viable because the object had to be serialized to a byte array (which is now massive - don't know how big yet because it is still writing). So I hunted around and found a BlobStream object that I tweaked for my usage. While pausing the debugger to check its progress I discovered that the binary formatter writes one byte at a time. Although generally sensible, it isn't really desirable for me - I'd rather write in much larger blocks - possibly 0.5 meg at a time. There appears to be no way of increasing the block size of the formatter - it's creating a one-element array for every byte and so calling the Write method millions of times. I could use Reflector, see how it all works and write my own but it seems like overkill for this purpose. Does anyone know if there is a way to change how the binaryformatter writes to a stream OR if there is a class already out there that will allow me to do this? Thanks very much





Similar Threads
Thread Thread Starter Forum Replies Last Post
having problems in for each.. abhishek verma XSLT 1 January 24th, 2006 05:29 AM
validate.asp problems and logon.asp problems p2ptolu Classic ASP Databases 0 February 16th, 2005 02:34 PM
more problems Andy122 Dreamweaver (all versions) 5 January 6th, 2005 04:22 PM
Problems...? Snib Forum and Wrox.com Feedback 0 June 2nd, 2004 08:27 PM
Two Problems goraya C# 2 May 21st, 2004 05:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.