VBA said:
Do the stream objects in .NET support any tipe of content i'd like to put
in
them?, like memorystream...can i put a table in there? or a stream inside
another stream?
You always Read or Write arrays of bytes into the Stream objects. You
can put inside anything that you want, as long as you know how to convert it
to/from an array of bytes; the Stream will not do the conversion for you.
One object that "knows" how to do such a conversion is a Formatter (such
as the BinaryFormatter and the SoapFormatter). These formatters take an
arbitrary object, on the condition that it be Serializable, and then write a
representation of the object into a Stream.
A Stream "inside" another Stream doesn't make much sense. What you
sometimes have to do is connect the output of a Stream to the input of
another one. This happens, for instance, when you want to encrypt something
into a file: you connect a CryptoStream with a FileStream. The CryptoStream
receives an array of bytes, and the FileStream writes another array of bytes
into the file.