none
understanding the data stream object RRS feed

  • Question

  • Hi.  I'm not an OO person but I'm trying to understand how data streams are accomplished in what I heard are progam to program interfaces/communications. 

    In my mind they are continuous streams of data but somehow are represented in an oo object/class whose underlying protocol might be json, avro etc. 

    But if they are moving "targets", what is going on underneath the covers as feeds from various apps are made available to consuming apps?  Is the consuming app constantly asking for updates, perhaps prior to a certain point in time, from the feeding app?  my limited knowledge mkes me think an object has to be discrete at a/any specific point in time.

    This is mostly out of curiosity.

    Thursday, June 27, 2019 8:39 PM

Answers

  • Hi db042190,

    Streams are just a way of abstracting a sequence of bytes so that you can read from/write to (and usually seek within) them. To turn an object into a stream or byte array you must use the BinaryFormatter (or SoapFormatter) together with the Serializiable and NonSerialized attributes applied to fields of objects that you serialize. Serializing an object just writes its field data to any stream of your choice (since System.IO.Stream is the base class, you can write to a MemoryStream, FileStream, NetworkStream, etc.)

    This is how the stream works.

    >>I'm just trying t understand what happens behind the scenes when a data stream is consumed by an app. 

    After the use of the stream, the stream would be convert to the data the app want or still be the stream which used to transfer.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by db042190 Tuesday, July 2, 2019 3:03 PM
    Tuesday, July 2, 2019 9:00 AM
    Moderator

All replies

  • Hi db042190,

    Thank you for posting here.

    For your question, I am confused about that. Could you provide more details with code about that?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 1, 2019 2:37 AM
    Moderator
  • thx Wendy.  I dont have any code.  I'm just trying t understand what happens behind the scenes when a data stream is consumed by an app.  Is there a certain object type perhaps called data stream that gets involved?  Does the consuming app need to keep polling the source of the data?  And is there generally an indication (maybe timestamp) in the object itself that identifies (or can help identify) data not previously seen by the consuming app?  
    Monday, July 1, 2019 11:17 AM
  • Hi db042190,

    Streams are just a way of abstracting a sequence of bytes so that you can read from/write to (and usually seek within) them. To turn an object into a stream or byte array you must use the BinaryFormatter (or SoapFormatter) together with the Serializiable and NonSerialized attributes applied to fields of objects that you serialize. Serializing an object just writes its field data to any stream of your choice (since System.IO.Stream is the base class, you can write to a MemoryStream, FileStream, NetworkStream, etc.)

    This is how the stream works.

    >>I'm just trying t understand what happens behind the scenes when a data stream is consumed by an app. 

    After the use of the stream, the stream would be convert to the data the app want or still be the stream which used to transfer.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by db042190 Tuesday, July 2, 2019 3:03 PM
    Tuesday, July 2, 2019 9:00 AM
    Moderator