question

GEMWare-4391 avatar image
0 Votes"
GEMWare-4391 asked GEMWare-4391 commented

Implementing IO Stream in VB/C#

Hi,

I was wondering if someone would be able to to give me a bit of an crash course on implementing the "IO.Stream" class with their override properties and statement(s). I mean that I under stand how the IO stream itself works. But the part of taking data from the source stream, then doing thing with the data before writing the data to its base stream is the part that I quite understand fully. For the sake of an example, both Compression and Decompression IO stream(s) for how they work their inner workings with the data would be the best way that I can explain for that I'm trying to understand.

In the example case of Compression and Decompression IO streams to my understanding that both of their streams are both "One-Way" streams that I'm aware of. And that's all fine and dandy and able to work with that. But with doing things like "Two-Way" IO streaming from the same base stream "Without" closing the base stream is the part that I just don't quite follow for the way that works like in Network stream. "ex., Compress the data before sending on the network stream. Then decompressing that data on the receiving network stream. Then doing the process in reverse on the same stream." Even encryption streams is another example for what I'm trying to explain and trying to understand for when it comes to how IO streams function.

So if anyone is able provide me with ether some well laid out block diagrams, or some kind of source code example(s) with proper documentation, would be awesome. I can work with C# source code example(s) if needed, but I would rather prefer VB source code example(s) instead. Or at least well documented block diagram(s) and/or example(s) the explains in enough detail for how to implement the "IO.Stream" class because the way that the MSDN is laid out these days tends to make things more head scratching for me then it really needs too be.

Thank you for your time...

GEMWare

P.S. to the MSDN Development Team...

If all possible as a request. Could you pass this message to the "Higher-Up(s)" to fix and cleanup the MSDN .Net Framework Documentation Library where the source code example(s) is more properly displayed and not glitched. And also for any object(s) and/or control class(s) inherited base statements is at least ether Hidden or Collapsed if not removed from what is relevant to a given control or object. And plus to add better explanation for using object(s) and their given statement(s) for were they are better lade out and more readable.

Because depending on what a person is trying to look for and learn. That there would ether be "Way" too much information, or "No" useful information at all to the point of no purpose of a given link to click on. I mean that a person reading a given page has to be psychic for what little that is explain. Properties references seems to be the worst for this from what I've see. Its to the point of ether someone forgot to add the documentation for one reason or another, or that someone got promoted from useless to jobless and that no one took over.

dotnet-csharpdotnet-visual-basic
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GEMWare-4391 , based on my research, you can refer to the link Stream.cs source code to know the source code of Stream class. About your request related to MSDN .Net Framework Documentation Library, you could request a feature about .NET in the Developer Community.


0 Votes 0 ·

Hay @JackJJun-MSFT , thanks for the response. I see that I'll be having a bit of fun with C# here, but that's Ok because that I need the practice anyways with C#. At least that your awesome with both link(s) for at least that it is something that I can start with. And I'll see what I can accomplish with-in the Dev Community about fixing the On-Line Framework Documentation Library because that it's a bit messy and needs some work if not a complete overhaul.

0 Votes 0 ·

@GEMWare-4391 , I have not heard from you for a couple of days. Please let me know if there is anything that I can help in here.

0 Votes 0 ·

@JackJJun-MSFT , I have done a bit of reading of it in between working on other parts of other sub projects and doing life stuff. In other words, I've been busy as hell. But for what I have managed to look through so far, it might take me a wee bit more time to make complete since of it all. Mostly because that is in C#, and that I'm a bit rusty when it comes to C-Based languages. But I am making some head's and tail's of it so far.

I do have a question or three though... For what code block statement(s) would I be adding/imbedding code in? The inherited Read/Write statement(s) that is ether pointing to or calling an internal Stream source?

0 Votes 0 ·

@GEMWare-4391,>>For what code block statement(s) would I be adding/imbedding code in?, what is your purpose to add the code block?
>>The inherited Read/Write statement(s) that is ether pointing to or calling an internal Stream source? I can not full understand about your meaning. Could you describe it more clearly?

0 Votes 0 ·

Hay @JackJJun-MSFT ,

I was considering in writing and imbedding my own variant of an "Two-Way" portable and secured data stream class that I use throughout all my .Net based projects for both Data Storage and Net Socket streaming. And don't get me wrong here because for the deferent types of IO streaming class that the .Net Framework has to offer dose work wonders. But they all are fixed variants and unable to much of anything but just to use them. Like for example, embed CRC protection when transceiving data between two or more devices over a network. Or another example would be to implement Software RAID within a stream class.

0 Votes 0 ·

@JackJJun-MSFT ,

Based form the IO.Stream link that there is an "SyncStream" class within that I've been studying line for line for how it has been laid out. And that I'm starting to understand how to inherit and use the IO.Stream as an base stream for a lot of the override statements just get's passed through to the internal stream that was referenced when calling a new class. And as for the Read\Write override statements is where I would grab the data and say for example "check for data corruption" before I continue to pass the data through the internal stream.

But this dose raise the question of, Dose is really matter if I was to inherit the IO.Stream class? Because that the part of inheriting a class as an base class is what has been making me scratching my head over.

And thank you for taking the time here in helping me with this...

GEM

0 Votes 0 ·

0 Answers