Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to save a Stream class

how to save a Stream class

Scheduled Pinned Locked Moved C#
questionhelptutorial
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hesham Yassin
    wrote on last edited by
    #1

    if i got data in a Stream class, how can i save it to a directory? please help, thanks

    M A 2 Replies Last reply
    0
    • H Hesham Yassin

      if i got data in a Stream class, how can i save it to a directory? please help, thanks

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Write it to a FileStream[^] :)

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • H Hesham Yassin

        if i got data in a Stream class, how can i save it to a directory? please help, thanks

        A Offline
        A Offline
        Anthony Mushrow
        wrote on last edited by
        #3

        Err..

        Stream myStream = ...
        byte[] data = new byte[myStream.Length];
        myStream.Write(data, 0, (int)myStream.Length);
        FileStream fs = new FileStream(@"C:\", FileMode.Create);
        fs.Write(data, 0, data.Length);
        fs.Close();

        Would probably work. And you should probably buy yourself a beginners book.

        My current favourite word is: Nipple!

        -SK Genius

        Game Programming articles start -here[^]-

        H 1 Reply Last reply
        0
        • A Anthony Mushrow

          Err..

          Stream myStream = ...
          byte[] data = new byte[myStream.Length];
          myStream.Write(data, 0, (int)myStream.Length);
          FileStream fs = new FileStream(@"C:\", FileMode.Create);
          fs.Write(data, 0, data.Length);
          fs.Close();

          Would probably work. And you should probably buy yourself a beginners book.

          My current favourite word is: Nipple!

          -SK Genius

          Game Programming articles start -here[^]-

          H Offline
          H Offline
          Hesham Yassin
          wrote on last edited by
          #4

          theoretically u r right but in the "Stream" class there is no "Length" property. :sigh:

          A 1 Reply Last reply
          0
          • H Hesham Yassin

            theoretically u r right but in the "Stream" class there is no "Length" property. :sigh:

            A Offline
            A Offline
            Anthony Mushrow
            wrote on last edited by
            #5

            Well what kind of stream do you actually have? Because that probably does have a length property.

            My current favourite word is: Nipple!

            -SK Genius

            Game Programming articles start -here[^]-

            H 1 Reply Last reply
            0
            • A Anthony Mushrow

              Well what kind of stream do you actually have? Because that probably does have a length property.

              My current favourite word is: Nipple!

              -SK Genius

              Game Programming articles start -here[^]-

              H Offline
              H Offline
              Hesham Yassin
              wrote on last edited by
              #6

              thank u guys, i got the point!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups