Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:26:09+00:00 2026-05-22T21:26:09+00:00

Is it possible to open a file directly from a MemoryStream opposed to writing

  • 0

Is it possible to open a file directly from a MemoryStream opposed to writing to disk and doing Process.Start() ? Specifically a pdf file? If not, I guess I need to write the MemoryStream to disk (which is kind of annoying). Could someone then point me to a resource about how to write a MemoryStream to Disk?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:26:10+00:00Added an answer on May 22, 2026 at 9:26 pm

    It depends on the client 🙂 if the client will accept input from stdin you could push the dta to the client. Another possibility might be to write a named-pipes server or a socket-server – not trivial, but it may work.

    However, the simplest option is to just grab a temp file and write to that (and delete afterwards).

    var file = Path.GetTempFileName();
    using(var fileStream = File.OpenWrite(file))
    {
        var buffer = memStream.GetBuffer();
        fileStream.Write(buffer, 0, (int)memStream.Length);
    }
    

    Remember to clean up the file when you are done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Open file from complete path under cursor in Vim Let's say I
Is is possible to open a text file and read the contents while another
Is it possible to open the same file in two separate windows in Xcode.
I was wondering if it is possible to open an xml file as a
Is it possible to open a .mdf database file created in Visual Studio with
By using fdopen() , fileno() it's possible to open streams with existing file descriptors.
Is it possible for a python script to open its own source file and
Is it possible to open an iPhone application or an Xcode project from the
Is it possible to open 2 documents from an xQuery and do a join
Is it possible to directly open an Office document that's in a Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.