StreamWriter.Write: Not possible to write byte array? Only Char array?

Posted on 2006-04-10
Last Modified: 2012-08-13

I need to write an array to a file with StreamWriter. I am now using a Char Array as StreamWriter.write does only support char arrays, not byte arrays...

Now how can I flush the char array when I dont need it anymore?


Question by:Ruttensoft
    LVL 15

    Accepted Solution

    im not quite sure what you are asking... you want to clear the char array? in VB you could do chararray = nothing

    you can convert binary data to a base64 string and write it as a string if that helps..


    and then use convert.FromBase64String to turn it back into a byte array froma string when you read it back.
    LVL 96

    Assisted Solution

    by:Bob Learned
    BinaryWriter can write byte array.

    LVL 9

    Assisted Solution

    by:Naveen Swamy

    Author Comment

    Thnx a lot for your answers, actually chararray = nothing is all I needed!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now