stream

streaming wav files

I have a server that sends data via a socket, the data is a wav 'file'. I can easily write the data to disk and then play it in WMP, but I have no idea how I can play it as I read it from the socket. Is it possible? Bonus question: how would I do it if the stream was in mp3 or other format? This is for windows in native C++. ...

What is the best way to read GetResponseStream() ?

What is the best way to read an HTTP response from GetResponseStream ? Currently I'm using the following approach. Using SReader As StreamReader = New StreamReader(HttpRes.GetResponseStream) SourceCode = SReader.ReadToEnd() End Using I'm not quite sure if this is the most effecient way to read an http response. I need the output ...

Question about XMLTextWriters and Streams

We have a VXML project that a 3rd party parses to provide us with a phone navigation system. We require them to enter an id code to leave a message, which is later reviewed by our company. We currently have this working as follows: Response.Cache.SetCacheability(HttpCacheability.NoCache); Stream m = new MemoryStream(); //Create Memory ...

Does NetworkStream.DataAvailable see buffered data?

Does NetworkStream.DataAvialable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter... Specifically, for some socket work involving an ongoing conversation, I currently use a length-prefix so the the receiver knows exactly how much data is i...

Compare view with stream

I use ClearCase. I have a snapshot view. Is there a way to compare this view with stream to find changed files? In TortoiseSVN this is called "Check for modifications" and shows all difference between local copy and what we have in the repo. ...

Padding - Encryption algorithm

Hello, I'm writing an implementation of the XXTEA encryption algorithm that works on "streams", ie, can be used like: crypt mykey < myfile > output. One of the requisites is that it doesn't have access to the file at all (it only reads an fixed size block until find an EOF). The algorithm needs that the data bytes is multiple of 4, so i...

Play Audio from a Stream using C#

Is there a way in C# to play audio (e.g. MP3) direcly from a Stream (I mean the real .NET class) that for instance was returend from a WebRequest without saving the data temporarily to the disk? Solution with NAudio With the help of NAudio 1.3 it is possible to: load a mp3 file from a url into a MemoryStream convert mp3 data into w...

How does one use FileStream to append to a file without an exclusive lock?

What I'm trying to do with FileStream in C#/.NET is to open two streams: one appending to a file and the other reading those writes asynchronously (for unit testing some network connection handling code). I can't figure out how to get the writer stream to open the file in non-exlusive locking mode and thus the code always throws an exce...

java connection to jabber

What type of stream I need to use to write a connect request message over a tcp socket, to jabber. I'mwriting a string with xml format. It should worked with the default socket stream or a dataoutputstream but it doesn't. ...

Reading a single XML document from a stream using dom4j

I'm trying to read a single XML document from stream at a time using dom4j, process it, then proceed to the next document on the stream. Unfortunately, dom4j's SAXReader (using JAXP under the covers) keeps reading and chokes on the following document element. Is there a way to get the SAXReader to stop reading the stream once it finds ...

.NET Does NOT Have Reliable Asynchronouos Socket Communication?

I once wrote a Crawler in .NET. In order to improve its scalability, I tried to take advantage of asynchronous API of .NET. The System.Net.HttpWebRequest has asynchronous API BeginGetResponse/EndGetResponse. However, this pair of API is just to get a HTTP response headers and a Stream instance from which we can extract HTTP response co...

How do I turn a String into a Stream in java?

I need to transform a string into (finally) an InputStreamReader. Any ideas? ...

How do I safely create an XPathNavigator against a Stream in C#?

Given a Stream as input, how do I safely create an XPathNavigator against an XML data source? The XML data source: May possibly contain invalid hexadecimal characters that need to be removed. May contain characters that do not match the declared encoding of the document. As an example, some XML data sources in the cloud will have a ...

How to cut out a part from a stream in Delphi7

I have an incoming soap message wich form is TStream (Delphi7), server that send this soap is in development mode and adds a html header to the message for debugging purposes. Now i need to cut out the html header part from it before i can pass it to soap converter. It starts from the beginning with 'pre' tag and ends with '/pre' tag. Im...

Esper versus Coral8 . . .Event stream processing

has anyone done any analysis comparing coral8 versus esper for event stream processing? ...

Convert a String to Stream

I've download an image from the Internet and converted to a String (This is not changeable) Dim Request As System.Net.WebRequest = _ System.Net.WebRequest.Create( _ "http://www.google.com/images/nav_logo.png") Dim WebResponse As System.Net.HttpWebResponse = _ DirectCast(Request.GetResponse(), System....

How to read/store unicode with STL strings and streams

I need to modify my program to accept Unicode, which may come from any of UTF-8 and the various UTF-16 and UTF-32 encodings. I don't really know much about Unicode (though I've read Joel Spolsky's article and the Wikipedia page). Right now I'm using an std::istream and reading my input char by char, and then storing (when necessary) in...

What is a good commercial tar stream lib for c# and .net?

We are currently using SharpZipLib but since it uses the GPL we need to replace it with a commercial lib. ...

Convert RTF Stream to Plain Text Stream

I have crystal report and I need to convert it to text file. Currently I can only convert it to RTF Stream. Now I need to convert the RTF Stream to Text Stream. I am using C#. Thanks. ...

extracting stream from pdf in python

How can I extract the part of this stream (the one named BLABLABLA) from the pdf file which contains it?? <</Contents 583 0 R/CropBox[0 0 595.22 842]/MediaBox[0 0 595.22 842]/Parent 29 0 /Resources<</ColorSpace<</CS0 563 0 R>>/ExtGState<</GS0 568 0 R>>/Font<</TT0 559 0 R/TT1 560 0 R/TT2 561 0 R/TT3 562 0 R>>/ProcSet[/PDF/Text/ImageC]/P...