stream

What is the correct way to read a MIME encoded stream?

I have a TCP socket with streaming MIME messages on it. I can use the JavaMail API to parse one MIME message at a time by searching for the boundary, then looking for the boundary + -- symbol. This seems like a lot of String manipulation. Someone out there has to have done MIME-encoded streaming correctly in Java. Where is it hiding? ...

Using ServletOutputStream to write very large files in a Java servlet without memory issues

I am using IBM Websphere Application Server v6 and Java 1.4 and am trying to write large CSV files to the ServletOutputStream for a user to download. Files are ranging from a 50-750MB at the moment. The smaller files aren't causing too much of a problem but with the larger files it appears that it is being written into the heap which is...

System.IO.Stream disposable with a reader

Can't remember where I read it, but I remember a MS guy saying that once you create a reader around a System.IO.Stream, then the stream is not longer responsible for the disposal of the stream. Is this true? Can someone confirm this? Maybe provide a reference. This means the outer using in this code is redundant using (var s = new Fil...

Generating Client Proxy from a Windows Service

I am trying to generate a client proxy from a WCF service library. I am using VS2005, .NET 3.0 on a Windows XP Pro workstation. The WCF service is hosted in a windows service. When I run the windows service as a console application, there are no problems. I can run svcutil.exe against that address and it generates the proxy. However, whe...

How to use NSOutputStream's write message?

I want to send a UIImage to a server through a socket. a)I open the outputstream: - (IBAction)send:(id)sender { NSURL *website = [NSURL URLWithString:str_IP]; NSHost *host = [NSHost hostWithName:[website host]]; [NSStream getStreamsToHost:host port:1100 inputStream:nil outputStream: [oStream retain]; [oStream setDe...

When to close NSOutputStream?

I want to send the data of a UIImage to the server through a socket, so I: a) open NSOutputStream - (IBAction)send:(id)sender { NSURL *website = [NSURL URLWithString:str_IP]; NSHost *host = [NSHost hostWithName:[website host]]; [NSStream getStreamsToHost:host port:1100 inputStream:nil outputStream: [oStream retain]; ...

How can I tell that a stream has been read to the end?

I'm just writing an simple method witch reading data from a general stream - which means it could be possibly a FileStream or a NetworkStream without knowing the length of it. I repeatly read the stream into a byte[] and push the data to another stream or whatever. My question is, how can I notice the stream is finished? I tried to retur...

Problem reading in some byte data into a Bitmap

Hi folks, I'm trying to read in a hardcoded bitmap image into a bitmap object. I keep getting the same error: System.ArgumentException: Parameter is not valid. This is the code i have... const string fakeByteData = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUV...

Server disconnects in Java

Related posts didn't answer my question. I have a server which does something like: EVERY TWO SECONDS DO: if the inputstream is not null { if inputStream.available() is 0 { return } print "handling input stream" handleTheInputStream(); } Even after my client disconnects, the server doesn't recog...

Creating a pipe between C# and Ffmpeg

Hi guys, I have a C# program that creates a video and saves it to the disk in real-time. Instead of doing that, I want it to write it directly in a pipe connected with ffmpeg... The function that keeps saving the video in the disk, which I can not control, receives an IntPtr with a reference to the file. So, I need to create a pipe or...

Best way to close a stream an SAX parser is reading during the parsing process?

Hello dear Stackoverflow community! Let's get straight to my question: I have a socket and all input coming via this socket / stream is parsed by my SAX parser. Now, upon a certain parsing event I'd like to close the socket / stream from within my SAX event handler. Also, I want to close the stream from outside in a certain case while t...

Is that possible to stream mms,ASX,RTSP stream on iPhone?

I am making one application and I want to stream audio, I followed this link And now I can stream mp3 stream, but don't how to stream other mentioned format. Any help greatly appreciated. Cheers, Amit ...

Which method is better for sending a stream of images between two processes, local TCP/IP connection or Interprocess communication?

Assuming that I have to copy each image on the stream (I cannnot simply access that data with any mutex protection, it must be copied anyway), which method is better, pros/cons? I would like to know also how much performance loss this implied compared to using the images in the same process. Thanks ...

How do you merge two input streams in Java?

Having two InputStreams in Java, is there a way to merge them so you end with one InputStream that gives you the output of both streams? How? ...

Red5 stream flv file

Hi everybody I was inspecting the oflaDemo from Red5. I was wondering how I could change the oflaDemo so that I could stream a certain flv file to all the subscribers... /** {@inheritDoc} */ @Override public boolean appConnect(IConnection conn, Object[] params) { // Trigger calling of "onBWDone", required for some FLV play...

C++ stream to memory

Hi, how can I create std::ostream and std::istream objects to point to a piece of memory I allocated and manage (I don't want the stream to free my memory). I was looking at using rdbuf()->pubsetbuf() to modify one of the other streams - say sstringstream. However I think streambuf used by stringstream will free the buffer afterwards? ...

Can't stream Jpegs images over http in C#

Hello Guys, I 've a stream of Jpegs images and I'm trying to stream them with HTTP to VLC The code if the following: public HttpListenerResponse StartListening(String where) { listener = new HttpListener(); listener.Start(); Console.WriteLine("listening on " + where); listener.Prefixes.Add(where); ...

Parse router configuration output.

My router supports telnet sessions to configure my router, I want to make an application in c# that parses the console output into something useful. edit: the lines are seperated with "\n\r" and there are no \t characters used, everything is spaced out Example: bridge configuration for "bridge" : OBC : dest : Internal ...

Is there anything like 'getStreamsToHost' on real iPhone device?

I want to write an NSOutputStream to a server with apple's sample code: NSURL *website = [NSURL URLWithString:str_IP]; NSHost *host = [NSHost hostWithName:[website host]]; [NSStream getStreamsToHost:host port:1100 inputStream:nil outputStream: [oStream retain]; [oStream setDelegate:self]; [oStream scheduleInRunLoop:[NSRunLoop currentRu...

Duplicating a stream

Hi, I have a producer which provides a System.IO.Stream instance. I also have several clients which consume this stream. Is it possible to give each client a "private view" of the stream? For example, if clientA reads from the stream, it doesn't affect the position clientB sees (i.e. if clientB start reading from the stream, it gets th...