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. Is this how MemoryStreams works?

Is this how MemoryStreams works?

Scheduled Pinned Locked Moved C#
helpquestion
4 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.
  • S Offline
    S Offline
    Snowjim
    wrote on last edited by
    #1

    Hey! I need som help on the MemoryStream. 1. Is MemoryStream contaning one ore two streams? 1.2. If the MemoryStream only contains one stream, is it still posible to send data in both directions, or do i need to have two MemoryStreams to do that? 1.3. If the MemoryStream is containgn two streams, how do i know what stream i am reading and writing from? As you can see, i have some problem to understand Streams, if you got the time to explain, i would appreciate it! Best Regards Jimmy

    L 1 Reply Last reply
    0
    • S Snowjim

      Hey! I need som help on the MemoryStream. 1. Is MemoryStream contaning one ore two streams? 1.2. If the MemoryStream only contains one stream, is it still posible to send data in both directions, or do i need to have two MemoryStreams to do that? 1.3. If the MemoryStream is containgn two streams, how do i know what stream i am reading and writing from? As you can see, i have some problem to understand Streams, if you got the time to explain, i would appreciate it! Best Regards Jimmy

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      A stream (note lower case as this applicable in most languages) is simply a sequence of bytes. Think of it as a byte[] with methods writing data sequentially with a position pointer (like a textbox caret). The position can be changed (if allowed) to read a previously written part. Reading and writing happen at the position pointer in a forward sequential manner. ;) xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

      S 1 Reply Last reply
      0
      • L leppie

        A stream (note lower case as this applicable in most languages) is simply a sequence of bytes. Think of it as a byte[] with methods writing data sequentially with a position pointer (like a textbox caret). The position can be changed (if allowed) to read a previously written part. Reading and writing happen at the position pointer in a forward sequential manner. ;) xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

        S Offline
        S Offline
        Snowjim
        wrote on last edited by
        #3

        Okay understand But will i have to use two streams to be abled to send data in both directions? Best Regards SnowJim

        S 1 Reply Last reply
        0
        • S Snowjim

          Okay understand But will i have to use two streams to be abled to send data in both directions? Best Regards SnowJim

          S Offline
          S Offline
          Steven Campbell
          wrote on last edited by
          #4

          A memorystream does not go anywhere, except to memory, so I am unsure what you could mean by "send data in both directions". In any case, if you need to both read from a stream, and write to a stream, you would normally use 2 streams to do that.


          my blog

          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