471,610 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

perhaps I just don't understand streams as well as I should...

Okay, maybe I'm trying to use streams in some unacceptable way, but I'm
running into a few problems.

I need to be able to serialize a set of data and deserialize it in
another place. It seems kind of pointless in one app, but since data
could come remotely, it's easiest to always serialize and deserialize in
the same place.

At the moment, I'm having trouble moving streams around. I need to be
able to have an object point to a stream for handling serializing an
object, and another object point to the same stream for deserializing
the object (at the moment, this is all proof-of-concept stuff).

Unfortunately, if I try and deserialize off of the same stream, I keep
getting errors about reading from the end of the stream. I understand
why that would happen, since the stream has written and is now at the
end of the stream. What I don't understand is how to deal with this.

Lee Crabtree
Feb 20 '06 #1
2 1125
Lee,

After serializing into the stream revert the stream pointer.

You can do that eather useing the Position proeprty or using the Seek
method. Some of the streams cannot be sought; these are usually the streams
for net resources. If you now nothing about the stream you should check the
CanSeek property.
--
HTH
Stoitcho Goutsev (100)

"Lee Crabtree" <lc*******@goisi.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Okay, maybe I'm trying to use streams in some unacceptable way, but I'm
running into a few problems.

I need to be able to serialize a set of data and deserialize it in another
place. It seems kind of pointless in one app, but since data could come
remotely, it's easiest to always serialize and deserialize in the same
place.

At the moment, I'm having trouble moving streams around. I need to be
able to have an object point to a stream for handling serializing an
object, and another object point to the same stream for deserializing the
object (at the moment, this is all proof-of-concept stuff).

Unfortunately, if I try and deserialize off of the same stream, I keep
getting errors about reading from the end of the stream. I understand why
that would happen, since the stream has written and is now at the end of
the stream. What I don't understand is how to deal with this.

Lee Crabtree

Feb 20 '06 #2
Okay, that's what I found initially, but I wasn't sure if there was a
better way to go about it all. Thanks.

Lee Crabtree

Stoitcho Goutsev (100) wrote:
Lee,

After serializing into the stream revert the stream pointer.

You can do that eather useing the Position proeprty or using the Seek
method. Some of the streams cannot be sought; these are usually the streams
for net resources. If you now nothing about the stream you should check the
CanSeek property.

Feb 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Alligator | last post: by
303 posts views Thread by mike420 | last post: by
3 posts views Thread by sb | last post: by
9 posts views Thread by Carsten H. Pedersen | last post: by
11 posts views Thread by Martin Joergensen | last post: by
85 posts views Thread by Russ | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by

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.