472,353 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Stream not readable problem


I got a 'stream not readable' exception. I'd appreciate if some one can tell
me how i can overcome this.

My Exception
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information: System.Web.Services.Protocols.SoapException: Server
was unable to process request. ---> System.ArgumentException: Stream was not
at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean
detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(Stream stream)
at WebService1.Service1.GetCompressedData() in
c:\inetpub\wwwroot\webservice1\service1.asmx.cs:li ne 114
--- End of inner exception stack trace ---

My code
public string GetCompressedData()
TextReader textreader;
DataSet ds = new DataSet();

// populate dataset

byte[] bytes = System.Text.Encoding.UTF8.GetBytes(ds.GetXml());

// compress using
using(MemoryStream sourcestream = new MemoryStream(bytes))
MemoryStream destinationStream = new MemoryStream();
using (XceedCompressedStream xcs =
byte[] buffer = new byte[ 32768 ];
int bytesRead = 0;

while( ( bytesRead = sourcestream.Read( buffer, 0, buffer.Length ) )
0 )

xcs.Write( buffer, 0, bytesRead );
textreader = new StreamReader(destinationStream); // **** line 114 ****
return textreader.ReadToEnd();
Jul 19 '05 #1
0 5832

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Alfred | last post by:
I just write a problem. It use 5 threads to set value in the buffer value and 5 threads to get the buffer value. The buffer only can handle 3 array....
by: dbuser | last post by:
Hi, I have to implement every even and odd character swapping of a stream. My problem is with the following code is that if the stream has total...
by: Ryan Ternier | last post by:
I'm writing a file out using StreamWriter. What i'm outputting is a 6,398 lines of stupid Jscript arrays. Yes the system needs to be very very...
by: Jack Russell | last post by:
Stream reader Readline returns "Nothing" if at the end of the stream. However it also seems to return nothing if it comes across a line with...
by: hs | last post by:
Hi I got a 'stream not readable' exception. I'd appreciate if some one can tell me how i can overcome this. thanks My Exception...
by: noone | last post by:
I have what I believe is a common problem. I must pull protocol messages in from a data stream and save them as subclassed objects. the messages...
by: Nobody | last post by:
I'm trying to put together code to deal with a SOAP with attachements response, and I'd like to process the response in a single pass. The SOAP...
by: =?Utf-8?B?TWFya3VzU3Ryb2Js?= | last post by:
Hi all! I'm currently developing a file upload and download server using WCF using the streamed transfer mode. When i download a file i open a...
by: fevos | last post by:
Hi i want to record voice and send it throw Bluetooth stream , the problem is the recorder accepts only I.O Stream And write at the 'stream'...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

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.