stream

filtering streams in c#

What's the easiest way to filter a stream/reader line-by-line in c# (somewhat like putting sed in the middle of a pipeline). I want to feed an iCalendar file to DDay.iCal but DDay.iCal dies on "VERSION:5.1.1" because it wants a number or number SEMICOLON number (where number is digits (DOT digits)? so the last "." is unexpected). What ...

How do I test if a string exists in a Genshi stream?

I'm working on a plugin for Trac and am inserting some javascript into the rendered HTML by manipulating the Genshi stream. I need to test if a javascript function is already in the HTML and if it is then overwrite it with a new version, if it isn't then add it to the HTML. How do I perform a search to see if the function is already th...

Playing URL of MP3 from iPhone

I am trying to find the best way to play a URL of an mp3. I've tried Audiostreamer but it doesn't fit my needs as it's geared towards infinite streams, and not finite streams. Any help is appreciated! Thanks! ...

Read content of RAR files using C#

Well the title says it all. Is there any way to read the content of a RAR file (support for multi-file RAR is a must)? I don't want to extract the content to the disk, just read it like a stream. ...

[iPhone] Different instances of SystemSoundID playing on different streams !

Hello. First, thanks for the StackOverflow team, cause it's a very useful website, since i'm developping on iPhone. Secondary, please excuse my language. I'm a frenchie and like every frenchies i'm very bad in english. I've a very strange problem with my sounds in my iPhone program : I implemented a class which play a short sound in aif...

Write simultaneousely to two streams

Is there a way to to couple two streams (or file descriptors) together so that writing to one stream will also write to the second one? (C, Linux) Thanks. ...

A generic error occurred in GDI+.

[ExternalException (0x80004005): A generic error occurred in GDI+.] IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId, Guid ImageId, ImageTransformCollection toDoTransforms) +1967 IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId...

Writing a stream protocol: Message size field or Message delimiter?

Hi all, I am about to write a message protocol going over a TCP stream. The receiver needs to know where the message boundaries are. I can either send 1) fixed length messages, 2) size fields so the receiver knows how big the message is, or 3) a unique message terminator (I guess this can't be used anywhere else in the message). ...

.NET 1.1 WSDL - Unable to use IntPtr (WindowsIdentity.Token) as input param on WebMethod (ASMX Web Service)

We're in a strange situation with a legacy winforms VB.NET 1.1 application using ASMX web services. Trying to send a user Token from a WindowsIdentity object as a parameter to a WebMethod. I will be adding a 'HACK: comment. System.Security.Principal.WindowsIdentity.GetCurrent().Token The token is of type IntPtr, the first problem is t...

How to analyze a video stream

Is it possible to analyze a video stream on the fly? For example, say i have a TV tuner installed and want to do some pixel testing every .5 seconds. How would one go about doing analysis? Would it be the same procedure if it was a video file (ie .mpg / .wma)? ...

How can I split (copy) a Stream in .NET?

Does anyone know where I can find a Stream splitter implementation? I'm looking to take a Stream, and obtain two separate streams that can be independently read and closed without impacting each other. These streams should each return the same binary data that the original stream would. No need to implement Position or Seek and such...

PdfSharp save to MemoryStream

I want to save a PDFSharp.Pdf.PDFDocument by it's Save method to a Stream, but it doesn't attach the pdf header settings to it. So when I read back the Stream and return it to the user, he see that the pdf file is invalid. Is there a solution to attach the pdf header settings when PdfSharp saves to memory? ...

Why a BinaryWriter closes the outer Stream on disposal, and how to prevent that? (.NET C#)

I have one method that receives a Stream to write on it using a BinaryWriter. But when I dispose this BinaryWriter it also closes the stream. Can I leave it undisposed so I can leave my stream open? ...

playing a stream of PCM audio on .NET CF

I have a .NET CF library that produces PCM formatted data stream (as Stream object) from an MP3 file. I want to make my Windows Mobile phone to play the podcast I decode with that library. How can I play the PCM stream? I have tried PlaySound pinvoke stuff but does not work. It expects the entire song to be in memory as a WAVE file, whic...

java file input with rewind()/reset() capability

I need to write a function that takes in some kind of input stream thing (e.g. an InputStream or a FileChannel) in order to read a large file in two passes: once to precompute some capacities, and second to do the "real" work. I do not want the whole file loaded into memory at once (unless it is small). Is there an appropriate Java clas...

Delphi and HDD I/O Quoting , Resource Pre-Caching , Read/Write/seek parameter limiting.

I have dynamic array filled with bytes, which are read from .raw file with BlockRead() and this operation, logically, requires hell of a Shell resources and I wanted to know if there is any methods to reserve some amount or limit maximum amount of Read/Write/Seek used for Program run time from Hard Disk Drive*** [Clarification]: I meant...

Redirecting C++ fstream

So I have a C++ program, that normally when it executes writes out things to a log file. This is done using an fstream. However, now I want to include functionality to turn the logging off. Essentially, my code looks like this: bool isLogging; fstream* logFilePtr; throughout my code, there are a bunch of statements like: (*logFile...

Passing PHP output stream to Java

I am building an app using SOAP/web services to interact with a Java API. All was going swimmingly until now. I need to pass an output stream as a param to a Java method from PHP. I am pretty sure I need to use PHP output buffering and fwrite, I am just not sure how to go about it. I know you can use Java in php by using $myJavaFromPHP...

ASP.NET MVC FileStreamResult not working as intended

I have the following code which I stripped out of any non-essential lines to leave the minimun reproducable case. What I expect is for it to return the image, but it doesn't. As far as I can see it returns an empty file: public ActionResult Thumbnail(int id) { var question = GetQuestion(db, id); var image = new Bitmap(question.I...

Streaming Audio/Video in WPF with early versions of WMP?

Hey guys I am developing a Wpf App for a large client base, and have just found out that Windows Media Player 10+ is required in order to properly use the MediaElement XAML class in my Form. I personally don't use WMP, so I did not have it updated in my system (it was version 9, so no video played). I know for a fact many of the clien...