Stream is serializable !?!?!

  • Thread starter Thread starter Andy Fish
  • Start date Start date
A

Andy Fish

Hi,

I notice that the System.IO.Stream class extends MarshalByRefObject which
has the [Serializable] attribute

I presume this means that a stream can be serialized

What does it mean to serialize a stream? Has anyone tried it?

Andy
 
Never tried it, but I would assume that it means you can serialize the
definition across to then stream data across. This is an interesting thought,
however, as serialization is used to stream data. If you experiment post
results, as this could be extremely interesting (although probably not as
useful) :-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
the reason I discovered it was serializable is I created a web service
interface that had a stream as a parameter

however, in the web service definition it creates, the parameter is a new
stream class it created (localhost.foo.Stream rather than System.IO.Stream),
which has just one member variable - an integer called position. Also the
class it generates is abstract so it's of no practical use



Cowboy (Gregory A. Beamer) - MVP said:
Never tried it, but I would assume that it means you can serialize the
definition across to then stream data across. This is an interesting
thought,
however, as serialization is used to stream data. If you experiment post
results, as this could be extremely interesting (although probably not as
useful) :-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


Andy Fish said:
Hi,

I notice that the System.IO.Stream class extends MarshalByRefObject which
has the [Serializable] attribute

I presume this means that a stream can be serialized

What does it mean to serialize a stream? Has anyone tried it?

Andy
 
Stream is probably Serializable for MemeoryStream, to be serializable as
well.

Otherwise MarshalByRef means that you get a proxy, if use in remorting, so
it's certainly a copy which cross process...
 
Back
Top