streamwriter.write

C

cloud

hello all,
i have littile problem with streamwriter.write
the string which i am going to write is very very large (for example
7mb)
if we are writing that large string to the network stream using
streamwriter.write(teststring)
it takes some time to write that string.

Mean while is it possible to know how much it has written..

Thank you
 
G

Gregory A. Beamer

hello all,
i have littile problem with streamwriter.write
the string which i am going to write is very very large (for example
7mb)
if we are writing that large string to the network stream using
streamwriter.write(teststring)
it takes some time to write that string.

Mean while is it possible to know how much it has written..


Is there anyway you can chunk the data up into logical bits? If so, I
would aim for this option. A single write seems rather inefficient - in
most apps, at least.

If not, you have the stream option to output in smaller chunks. You can
feed a string into a memory stream and then stream to the streamwriter.

If you can chunk up the message, you have a fairly easy way to keep
track of what has been written. Set up the right "chunk" size and you
have a more efficient method of saving, which may increase performance
(ie, use the right size buffer).

I do not know of any method to query a write operation for percentage,
however.

Peace and Grace,


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

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:
http://www.crazycancertour.com

*******************************************
| Think outside the box! |
*******************************************
 
G

great stuff

Is there anyway you can chunk the data up into logical bits? If so, I
would aim for this option. A single write seems rather inefficient - in
most apps, at least.

If not, you have the stream option to output in smaller chunks. You can
feed a string into a memory stream and then stream to the streamwriter.

If you can chunk up the message, you have a fairly easy way to keep
track of what has been written. Set up the right "chunk" size and you
have a more efficient method of saving, which may increase performance
(ie, use the right size buffer).

I do not know of any method to query a write operation for percentage,
however.

Peace and Grace,

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

Twitter: @gbworld
Blog:http://gregorybeamer.spaces.live.com

My vacation and childhood cancer awareness site:http://www.crazycancertour.com

*******************************************
|      Think outside the box!             |
*******************************************

While writing from memory stream to networkstream
how do i know the state..that how many bytes are written to the
networkstream...

Thanks for any suggestion
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top