Skip to main content

Questions tagged [stream]

DO NOT USE FOR THE JAVA STREAM API INTRODUCED IN JAVA 8 (use [java-stream] for those questions!) A stream is a series of data elements which can be accessed in a serial fashion.

stream
1 vote
3 answers
2k views

Help improve this INI parsing code

This is something simple I came up with for this question. I'm not entirely happy with it and I saw it as a chance to help improve my use of STL and streams based programming. std::wifstream file(L"\\...
1800 INFORMATION's user avatar
28 votes
6 answers
82k views

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) ...
44 votes
3 answers
125k views

How to read file content into istringstream?

In order to improve performance reading from a file, I'm trying to read the entire content of a big (several MB) file into memory and then use a istringstream to access the information. My question ...
Marcos Bento's user avatar
  • 2,040
4 votes
3 answers
5k views

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. ...
gbjbaanb's user avatar
  • 52.5k
42 votes
7 answers
22k views

How to write the content of one stream into another stream in .net?

I often run into the problem that I have one stream full of data and want to write everything of it into another stream. All code-examples out there use a buffer in form of a byte-array. Is there a ...
Thomas Danecker's user avatar
5 votes
4 answers
9k views

Read data in FileStream into a generic Stream

What's the most efficient way to read a stream into another stream? In this case, I'm trying to read data in a Filestream into a generic stream. I know I could do the following: 1. read line by line ...
James's user avatar
  • 479
2 votes
4 answers
1k views

Scatter/gather async socket I/O in .NET

I'm trying to use the Stream.BeginWrite Async I/O API in .NET for a high-throughput situation with many short messages. As such, a scatter/gather API will reduce the number of context switches (and ...
Shachar's user avatar
  • 943
4 votes
1 answer
2k views

Scalable socket event queue processing

My C# class must be able to process a high volume of events received via a tcp stream style socket connection. The volume of event messages received from the tcp server by the class's socket is ...
Wayne Bloss's user avatar
  • 5,510
3 votes
2 answers
4k views

Programmatically stream audio in Cocoa on the Mac

How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
Hans Sjunnesson's user avatar
4 votes
1 answer
2k views

Can an fdopen() cause a memory leak?

I use fdopen to associate a stream with an open file. When I close() the file, is the stream automatically disassociated as well, and all stream memory returned to the OS, or do I need to be aware of ...
Adam Davis's user avatar
101 votes
13 answers
162k views

How to convert a Reader to InputStream and a Writer to OutputStream?

Is there an easy way to avoid dealing with text encoding problems?
Andrei Savu's user avatar
  • 8,615
3 votes
1 answer
1k views

fprintf returns success but can't write to an existing file

In my code fprintf returns successfully by returning the number of bytes written in STREAM, but in the actual file the string I wrote is not there.
domlao's user avatar
  • 15.9k
5 votes
2 answers
4k views

Stream data (such as music) using PHP (or another language)

For years, I've been investigating how to create music streams from my computer. I've seen programs, but anything useful I've seen is Windows only (I use a Mac). Eventually, I got interested in how ...
stalepretzel's user avatar
  • 15.8k
23 votes
2 answers
3k views

WPF - Load Font from Stream?

I have a MemoryStream with the contents of a Font File (.ttf) and I would like to be able to create a FontFamily WPF object from that stream WITHOUT writing the contents of the stream to disk. I know ...
viggity's user avatar
  • 15.2k
516 votes
24 answers
504k views

Easy way to write contents of a Java InputStream to an OutputStream

I was surprised to find today that I couldn't track down any simple way to write the contents of an InputStream to an OutputStream in Java. Obviously, the byte buffer code isn't difficult to write, ...
Matt Sheppard's user avatar

15 30 50 per page