Re: StreamWriter.Write(bool value) --- How many bits/bytes should end up in the file?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/15/04


Date: Tue, 15 Jun 2004 17:46:21 +0100

John <johnfofawn@hotmail.com> wrote:
> Doh! You're right. I meant to say BinaryWriter.

Well BinaryWriter only writes out a single byte when you call
BinaryWriter.Write(bool). If you believe you have an example where you
believe it writes four bytes, please post it.
 
> I ended up writing a method that packs the bits into bytes and then
> writes the bytes out.

Right.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: StreamWriter.Write(bool value) --- How many bits/bytes should end up in the file?
    ... >> Doh! ... I meant to say BinaryWriter. ... Thanks for your patience! ... John ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Writing to Binary file
    ... I think you've misunderstood the point of BinaryWriter. ... If you're trying to keep data secret, you should use encryption ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Writing to Binary file
    ... I think you've misunderstood the point of BinaryWriter. ... If you're trying to keep data secret, you should use encryption ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: BinaryWriter/Reader question
    ... > BinaryWriter only has the Dispose. ... It does not have a Dispose() method ... BinaryWriter foo = new BinaryWriter; ... If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)