StreamWriter problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny Shi

    #1

    StreamWriter problem

    Hi,
    I am trying to write a file using WriteByte after
    creating a file stream.

    ....
    FileStream fs = new FileStream
    (FILE_NAME,File Mode.OpenOrCrea te,FileAccess.W rite);
    for(i = 0; i < M; i++)
    fs.WriteByte(so meBitmap.GetPix el(k,j).R);
    .....

    Apparently Windows adds some new line characters to the
    newly created file. How can I avoid this?

    Thanks.
    Danny
  • Jon Skeet [C# MVP]

    #2
    Re: StreamWriter problem

    Danny Shi <anonymous@disc ussions.microso ft.com> wrote:[color=blue]
    > I am trying to write a file using WriteByte after
    > creating a file stream.
    >
    > ...
    > FileStream fs = new FileStream
    > (FILE_NAME,File Mode.OpenOrCrea te,FileAccess.W rite);
    > for(i = 0; i < M; i++)
    > fs.WriteByte(so meBitmap.GetPix el(k,j).R);
    > ....
    >
    > Apparently Windows adds some new line characters to the
    > newly created file. How can I avoid this?[/color]

    Your subject mentions StreamWriter - how does that come into things?

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    Working...