473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Stream classes

Hey,

Could anyone tell me how far the Stream classes of .net are actually
used in actual develpment scenarios ? Or do people mostly just need to
use databases to write data ?

THanks !!

Jun 12 '07 #1
4 1849
On Jun 12, 12:27 pm, Zeba <coolz...@gmail.comwrote:
Could anyone tell me how far the Stream classes of .net are actually
used in actual develpment scenarios ? Or do people mostly just need to
use databases to write data ?
No, streams are vital all over the place - reading/writing data with
files and with network connections being the most common uses in my
experience.

Jon

Jun 12 '07 #2
Further - for BLOB manipulation, database streams can come into play
(just to counter your "just need to use databases" point).

Another biggie would be compression; very convenient via streams; a
pain otherwise.

Serialization works via streams, and that is a common theme in many
scenarios (albeit often wrapped via XmlReader/XmlWriter).

I guess how much you use them depends on what you tend to do; if you
are just throwing some aspx pages together then you probably won't see
them much; if you are writing a comms / security layer you'll see them
lots.

Marc
Jun 12 '07 #3
Thanks guys .. ! That was real helpful !

Jun 12 '07 #4
And while streams are not necessarily needed for things like reading
from the files, or a socket (I'm surprized no one picked up on this), it is
very, very convenient to have these things represented in a ubiquitous,
unified model.

For example, if you extend a WebRequest/WebResponse class, you have to
override the GetRequestStream method. The beauty of this abstraction in
returning a Stream is that the Stream can be any derivation you want, so it
doesn't have to necessarily be network related. As long as you stick to the
model of what a Stream is, you are fine, which allows for a deep level of
customization.

This is really true about abstract classes and interfaces in general,
when they are designed properly, and you stick to the meaning of the
contract (not the implementation), you gain incredible flexibility.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Marc Gravell" <ma**********@gmail.comwrote in message
news:O2**************@TK2MSFTNGP06.phx.gbl...
Further - for BLOB manipulation, database streams can come into play (just
to counter your "just need to use databases" point).

Another biggie would be compression; very convenient via streams; a pain
otherwise.

Serialization works via streams, and that is a common theme in many
scenarios (albeit often wrapped via XmlReader/XmlWriter).

I guess how much you use them depends on what you tend to do; if you are
just throwing some aspx pages together then you probably won't see them
much; if you are writing a comms / security layer you'll see them lots.

Marc
Jun 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rwawryk | last post by:
Hi, Does anybody know how to implement parametrized stream operator (such as setw, setfill)? I need to put into the stream variable of type char* without terminating NULL. It would be great if I...
1
by: Eric Chaves | last post by:
Hi folks, What is the pro an cons against using the reading/writing methods of stream based classes instead of using the reader/writer classes? As far as I could see, the only difference is that...
21
by: Jason Heyes | last post by:
I want to allow objects of my class to be read from an input stream. I am having trouble with the implementation. Here are the different approaches I have tried: // Version 1.0 - Default...
24
by: Hendrik Schober | last post by:
Hi, I have a 'std::istream' and need to read its whole contents into a string. How can I do this? TIA; Schobi
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
8
by: Marc Gravell | last post by:
I want to write a method that will accept a stream as a parameter, and which will write xml to the stream (based in reality on database results) using the XmlTextWriter class. However, this insists...
1
by: Michael | last post by:
I have a solution for this, but it feels wrong. If anyone could offer a better one, I'm all ears. (Or technically, eyes.) Basically, I have a bunch of classes. For concreteness, one is a...
4
by: =?utf-8?B?Qm9yaXMgRHXFoWVr?= | last post by:
Hello, (sorry to begin with Java in a Python list ;-) in Java, when I want to pass input to a function, I pass "InputStream", which is a base class of any input stream. In Python, I found...
36
by: puzzlecracker | last post by:
Would someone explain why this declaration is illegal: class Sample<T> where T : Stream, class
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.