Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > SoapExtensions, DIME Attachment and Pipes

Reply
Thread Tools

SoapExtensions, DIME Attachment and Pipes

 
 
Oleg
Guest
Posts: n/a
 
      09-30-2003
Does anybody know a good C# replacement for
java.io.PipedInputStream, PipedOutputStream?

The reason I'm asking is sometimes I need transfer really
amount of huge data (DataSet) using web services.
At the same time this data can be compressed up to 50
times using #ZipLib library.
I have tried SoapExtension & DIME Attachment methods.
They both work pretty well, except consuming too much
memory on both client and server sides.

I currently use this approach (DIME Attachment):
1. Create DataSet and populate it with data.
2. Create compressed memory stream [gzipStream = new
GZipOutputStream(new MemoryStream(1024))] (i.e.
MemoryStream "decorated by" GZipOutputStream)
2. Serialize the DataSet into the stream [ds.WriteXml
(gzipStream)]
3. Use gzipStream as input stream for DimeAttachment
[DimeAttachment dimeAttachment = new DimeAttachment
("application/x-gzip",
TypeFormatEnum.MediaType,
memoryStream)]

I'm not sure about implementation of dimeAttachment, but
I hope it writes data
from dimeAttachment stream directly (i.e. without
buffering whole stream in memory!) and asynchronously
into "network stream".

Things are much worse with SoapExtension...
(I can describe if somebody really interested

But if we can use PipedInputStream, PipedOutputStream it
will work like this:
1. Got populated DataSet.
2. Create connected PipedOutputStream & PipedInputStream.
3. Create new thread (T) and give it DataSet &
PipedOutputStream
4. When thread (T) runs, it starts writing DataSet into
PipedOutputStream "decorated" by GZipOutputStream.
5. Use PipedInputStream as input stream for DimeAttachment

The difference with previous scenario is that
we never have whole serialized & zipped DataSet in memory.
Instead we have only small part of it hold in a buffer
used by piped streams.
PipedOutputStream.write call will block when the buffer
is full.
PipedInputStream.read call will block when the buffer is
empty.

So, does anybody know a good C# replacement for
java.io.PipedInputStream, PipedOutputStream?
Sincerely,
Oleg

P.S. I know what asynchronous IO is. I.e. I think I
know!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to send a DIME attachment with SOAP Ipsita ASP .Net Web Services 1 11-16-2004 01:43 AM
How to send a DIME attachment with SOAP Ipsita ASP .Net 1 10-29-2004 04:45 PM
Problem with streaming a DIME attachment with SOAP Ipsita ASP .Net 3 10-29-2004 04:50 AM
DIME Attachment from Client to Server Senthil ASP .Net Web Services 2 10-08-2003 04:22 PM
Referenced DIME attachment David Dundua ASP .Net Web Services 0 07-23-2003 02:55 PM



Advertisments