Click here to Skip to main content
15,892,674 members
Everything / Stream

Stream

stream

Great Reads

by blitzkrieged
This is a demonstration of splicing an animated GIF (or any image) frame by frame without having to write to the disc.
by Andy South
We have established a goal to decide, what solution (as in a combination of software and services) among those we chose allows extending the audience of an event with minimum efforts.
by TheCannyCoder
Introduction to functional programming in Java 8
by Maximilian1986
Implement the Lambda expression to handle the class Shape in Java8: the power of declaration programming.

Latest Articles

by Adérito Silva
A demonstration about how to read an exact number of bytes from Stream objects
by honey the codewitch
Add progress reporting to your downloading or copying using this code
by Ray K
Extending BinaryReader/Writer to support a different byte order, string and date formats, and advanced navigation in binary files
by Sibeesh Passion
What if there is a tool which helps you create a stream solution in Visual Studio so that you don’t want to go over the browser and do some manual button clicks? That’s where the Azure Data Lake and Stream Analytics Tool extension come into play.

All Articles

Sort by Score

Stream 

14 Oct 2013 by blitzkrieged
This is a demonstration of splicing an animated GIF (or any image) frame by frame without having to write to the disc.
20 Mar 2011 by OriginalGriff
Easy: you just need to change one line:textfilestream.WriteLine(Product & " " & Size & " " & Cost)becomes:textfilestream.WriteLine("Product: " & Product & " Size: " & Size & " Cost: " & Cost)Or there is the advanced version: extfilestream.WriteLine("Product: {0} Size: {1} Cost :...
6 Apr 2011 by CPallini
Hint: do yourself your own homework and, please, please, read the FAQ before posting here again.
2 Mar 2014 by Richard MacCutchan
It is a rather old fashioned (C-style) way of reading integers from the standard input stream. The call to freopen redirects that file to stdin so it can be read with the calls to getchar. A much better way of doing it would be to use fscanf or one of the STL ifstream classes. The #ifdef _WIN32...
2 Mar 2014 by CPallini
The guy is using input stream redirection in order to use getchar to perform fgetc[^] task, that is reading a character at time from a file.In the ReadInt function, blanks and newlines are skipped, then digits are then read and used to build the resulting integer, until a blank, a newline or...
16 Feb 2016 by Andy South
We have established a goal to decide, what solution (as in a combination of software and services) among those we chose allows extending the audience of an event with minimum efforts.
3 Apr 2010 by Alan N
Existing text can be erased by overwriting with space characters. To clear one line the sequence would beSetCursor ROW, COLUMNWrite space * LINEWIDTHand that can easily be extended to clear a rectangular area by incrementing the ROW value within a loop.If it also possible to move...
15 Feb 2011 by Xcelsion
Dear Code Project community,I have a problem with images getting distorted when I try and convert them to a byte[] array using a memory stream. I need this to work because I am trying to create an MJPEG relay server. Using a BinaryWriter object to put the byte[] array on the network stream....
24 Mar 2012 by Sergey Alexandrovich Kryukov
Not byte! How can it be? You should use System.String which is the Unicode string, so it supports most languages at the same time. When you communicate through the network or any other kind of stream, all the text data is converted to/from the array of bytes anyway, but each character takes...
2 Aug 2023 by Andre Oosthuizen
The problem you are facing is likely related to the way you are handling the data reception. Reading data from the stream using 'stream.Read' may not guarantee that you receive all the data at once, you should modify your code to read from the...
13 Nov 2010 by thomas struss
I want a program that scans a list(doctors.txt) and determines if the first and second letter (the ones entered into textbox 1&2) matches a name on the list. The names that match should popup in a messagebox. I can get it to work in as a c++ console app, but not in a c# form app.I'm...
12 Nov 2010 by Heinzzy
Here it is. First of all remove the second "temp" line after while and you wont see any exceptions.string temp; const string path = @"F:\TEMP\doctors.txt"; StreamReader FileOut = new StreamReader(path); private void button1_Click(object sender, EventArgs e) ...
23 Feb 2011 by chualuoi
Hi everyone,I am now developing an conferencing application which use webcam as a video device. I am able to preview the webcam and capture image from it using directshow following the article here: DirectX.Capture Class Library[^]The directshow lib saves the video directly to my disk...
8 Jun 2011 by Sergey Alexandrovich Kryukov
Do you try to Google for it?There are million of code samples around.Just on CodeProject, first articles which caught my eye:C# \ VB.NET Camera Communication Libraries[^],Versatile WebCam C# library[^],WIA Scripting and .NET[^],WebCam Fast Image Capture Service using...
1 Dec 2013 by Sergey Alexandrovich Kryukov
You are perfectly right. First thing to note is: the difficulty you pointed out is a good evidence of the fact that your requirement makes little to no practical sense and should not be imposed for any real-life task. Also, the formulation of the question is inaccurate: in programming, even if...
2 Jul 2014 by TheCannyCoder
Introduction to functional programming in Java 8
10 Nov 2014 by ajay_mathew
I using C#.Net code to copy a file containing xml data to a location which is on a linux server. Soon after i copy the file i call a third party (java app) web-service that tries to consume the file copied. The third party service first tries to rename the file and in the process is getting an...
9 Sep 2015 by Sergey Alexandrovich Kryukov
This is a wrong, totally wrong question, as nearly all questions about "difference". In this particular case, this is the same as asking "what is the difference between penguin and bird?" Penguin is a bird, and FileStream is a...
10 Oct 2015 by Maximilian1986
Implement the Lambda expression to handle the class Shape in Java8: the power of declaration programming.
1 Jun 2016 by CPallini
You cannot serialize/deserialize a class containing std::string that way. See, for instance c++ - Serializing a class which contains a std::string - Stack Overflow[^].
29 Jun 2017 by Lockwood
Something like this? IO.FileStream fs = new IO.FileStream(myFile, IO.FileMode.Open, IO.FileAccess.Read); IO.MemoryStream ms = new IO.MemoryStream(); fs.CopyTo(ms);
10 Jan 2020 by Kris Lantz
According to the documentation here: Stream.ReadByte Method (System.IO) | Microsoft Docs[^], the ReadByte() Method is going to read the first byte of the stream, and advance by one, meaning using (var reader = new StreamReader(data)) will be processed from data[1], instead of data[0].
16 May 2020 by Richard MacCutchan
Running a simple operation like that in parallel adds an overhead to the processor which may mean that it does not actually run faster than a simple sequence. Adding 10,000 integers in sequence will always run quite fast owing to pipelining and...
17 Jun 2021 by OriginalGriff
If you are going to read all the lines anyway, why not just use: string[] lines = File.ReadAllLines(pathToFile); And what is this code going to do: currentLine = 0; if (currentLine == 1) return; currentLine--; That is the equivelant of just...
13 Jul 2021 by OriginalGriff
The three standard streams are specifically allocated to console I/O - you dont; use them to access files at all. Instead, your create a new stream for each file using the fopen function[^] which returns a FILE * - which is a pointer to a stream....
18 Feb 2022 by Richard MacCutchan
The first thing you need is a Python library that can handle these files. The first link thatGoogle finds is GitHub - globocom/m3u8: Python m3u8 Parser for HTTP Live Streaming (HLS) Transmissions[^].
25 Jun 2023 by Sandeep Mewara
You can use Google drive api's for such operation. In your case, you seem to need the list of files on drive such that you can specifically choose a file and thus the url for reference: Method: files.list �|� Google Drive �|� Google for...
11 Feb 2010 by Christian Graus
I expect if you look into the source, that ReadAllBytes does exactly what you're doing. It's better to use the shortcut as it's neater, but that is all.
10 May 2010 by William Winner
I'm a little bit confused with what you are asking, but here is what it seems to me.You want a ListBox to show just a name. You want that when the ListBox Item is clicked, you can pull out from that item where the video file is. Is that correct?If so, there are a couple of options...
19 Mar 2011 by hansalsal
i neeeeed your own code pleeeeeeaaaaaseof which records the webcam live videoplease upload it here or send it to my emailsalem.saleh72@yahoo.com
10 May 2011 by Mikicar
Hi, we have demand from customer to make asp.net live video stream from web cam and at the same time that stream to be saved as a video file for later usage.Can someone suggest approach to solve this?Thanks
11 May 2011 by Rick Shaub
You can still use File.SetAccessControl() in your new method in place of FileStream.SetAccessControl(). I'd be willing to bet it works, too. MSDN actually recommends this practice:"While the FileStream class and SetAccessControl can be used on an existing file, consider using the...
20 Oct 2012 by Richard MacCutchan
+-+-+| |+-+-+| | |+-+-+Reading each of these lines in turn gives you a string, which can also be addressed as an array of characters. After reading the first line the character at buffer[0] is the top left corner, the character at buffer[1] is the North wall of the first square,...
28 Mar 2013 by Sergey Alexandrovich Kryukov
Please see: http://www.codeproject.com/search.aspx?doctypeid=1&q=%28Webcam+OR+%22Web+camera%22+OR+%22USB+Camera%22%29+%22.NET%22[^].You will find some decent solutions.—SA
9 Oct 2013 by sandip1711
hi guys I’m new in broadcasting technologyI’m broadcasting using windows media encoder 9, what I want is while broadcasting when I use insert link option of windows media encoder 9 that time I want to change image path on broadcasting page but when I insert link(of image path) it is...
29 Dec 2014 by Shaun Blain
I would suggest that if you are using the code from the article you referenced that the issue is in there. I browsed through the source code and there are several items that I would clean up. The first two being the binary reader and writer. These should be specifically disposed when the class...
30 Dec 2014 by dev_assault
cant u do like int i = 1;and each time u write u pass it to the writeline and then increment.something like//have this in some methodstreamwriter sw;sw.WriteLine(String.Format("{0} \r\n {1} {2} \r\n", DateTime.Now, i, *whatever u wanna write to the file*));//and then increment...
28 Apr 2015 by Karthik_Mahalingam
HI Sathishbasically you are not supposed to ask the complete code directly, you shall try something and if u face any difficulty in that approach you can post the same here. asking the code is not encouraged in this forum. :)for now you can try the below .string folderLocation =...
9 Sep 2015 by ZurdoDev
See the documentation:Stream: https://msdn.microsoft.com/en-us/library/system.io.stream(v=vs.110).aspx[^]FileStream: https://msdn.microsoft.com/en-us/library/system.io.filestream(v=vs.110).aspx[^]FileStream is clearly more specific for files and Stream is the base class for FileStream.
9 Dec 2015 by ridoy
Why do you post the same question twice? Please delete the earlier one: How Can I Save A File Stream To A Folder As File?[^]You can use this method:public void CopyStream(Stream stream, string destPath){ using (var fileStream = new FileStream(destPath, FileMode.Create,...
23 Apr 2017 by OriginalGriff
Look at the documentation: PrintWriter (Java Platform SE 7 )[^] It says very clearly: Unlike the PrintStream class, if automatic flushing is enabled it will be done only when one of the println, printf, or format methods is invoked, rather than whenever a newline character happens to be output....
25 Apr 2017 by Dave Kreskowiak
Well, you can make it a tiny bit faster by replacing that string concatenation with a StringBuilder. Why? Because strings in .NET are immutable. Once created you cannot change them. What you're doing with that concatenation is creating a new string object every time you append something to it. ...
15 May 2017 by Ravi Bhavnani
I wrote (and currently use) these classes: WebResourceProvider goes .NET[^] StringParser[^] to allow me to consume data from a web site. However, please ensure that you have permission from the owners of the website to scrape data for use by your app. You may also want to consider simply...
17 Oct 2017 by KarstenK
It is NOT only primarly the programming language determining but also the useable code base and at most libraries. In your case of streaming your really should know and take a deep dive into ffmpeg which is a proven and well aknowled library which handles RTP/RTSP and MPEG-2 and has also...
20 Jul 2018 by Gerry Schmitz
How to webcast using Microsoft Expression Encoder[^]
2 Oct 2018 by #realJSOP
Just iterate the source folder and copy one file at a time. It really is that simple. Of course, you have to make sure the target path exists first, but really, this is minor file system stuff.
13 Dec 2018 by Sibeesh Passion
What if there is a tool which helps you create a stream solution in Visual Studio so that you don’t want to go over the browser and do some manual button clicks? That’s where the Azure Data Lake and Stream Analytics Tool extension come into play.
7 Nov 2020 by Patrice T
Quote: What can be problem? Can you help me? Without seeing the code, it will be complicated. Quote: Sorry i couldnt put my code, because it is so complex. if you help me about this, i will happy. Your code do not behave the way you expect, or...
28 Nov 2020 by OriginalGriff
Most likely reason is that the stream does not contain a valid (or at least known) image. Start by saving the file data, and look at exactly what the file contains. If it's binary data, that's a good sign. If it's human readable, then look at...
17 Jun 2021 by Richard MacCutchan
streamReader.ReadToEnd(); // file is now at end of file line = new List(); string lineS; while ((lineS = streamReader.ReadLine()) != null) // so nothing more to read. Also: currentLine =...
26 Mar 2010 by roman-korolev2007
Hi!My task is to get from my program, a data stream from a satellite/terrestrial tuner and parse them by PID...I am trying to enumerate all TV tuner/DVB devices, but I have no experience in that area. I found some samples:...
3 Apr 2010 by dxjhtian
In a C# Console application, I want to display some texts at the same position. While I can use the Console.SetCursorPosition() method to set the position, I have no idea that how can I clear the previously displayed text after that position(all text, or partial text within an area with a given...
3 Apr 2010 by Not Active
I guess Console.Clear is not what you are looking for?
3 Apr 2010 by Anthony Mushrow
You may want to take a look at Console.MoveBufferAreaI found it very convenient a while back to format some text on the console. If you simply print out the new text, then copy the entire block (plus enough white space, or err black space) to the where you need it.For example:int top =...
23 Jul 2010 by everywhereflowers
I'm planning to stream my usb tv tuner via specific protocol (ex: RTMP) to the media server (ex: Red5) that possible to control its channel from client (ex: flash application).Is there any ideas how do I get it working out? another protocol would be okay (RTMP, RTP, RTSP, or maybe using TCP...
12 Aug 2010 by atom64
Hi, I have written a program in c# which records the webcam live videobut I want to save the stream on ftp server as avi.The api on c# I use for capturing is directx.captureany ideas ?
4 Oct 2010 by kubi081
Hi,I'm working on a ASN1 decoding project. I've faced a problem that I could't figure out! The problem is ASN1C program is creating classes for me to use them for decoding process. But after decoding process I need to be able to serialize that class. But the problem is those classes (which...
10 Nov 2010 by fsidiosidi
Hi everyone,I want to know how can I add a delay (ex:200ms) to some received raw data before send it again through the network?thanks in advance for your help. :-D :-D
10 Dec 2010 by tareq07
Hi there, I would like to write a multicast video conference platform. I just wrote the SilverLight client application that captures a webcam and i can see one other person that connects to me. I now need to implement the MultiCast part where 5 users can see each other at the same time, live...
22 Dec 2010 by Rajeev Raina
I have to make call to a web service which will send a compressed (ZLIB) stream back to me. I have to de-compress the same stream and use it further.My problem is that I have to get it done on the client side using JavaScript/Ajax/JQuery etc.I already have code written/working in Java as...
22 Dec 2010 by Manfred Rudolf Bihy
Since you already have java code, why not wrap that into an applet. You can google "applet java javascript communication" on how to communicate with your applet from javascript. One link leads right back here for an article on...
15 Feb 2011 by Xcelsion
I solves this problem by using the byte stream from the source network stream directly works great. Unfortunately I still do not know exactly what causes the issue of the frame tearing.
23 Feb 2011 by Michael Waguih
Hi all,I have a place where there will be a meeting and I want to host for 60 other locations to view this meeting , can you help me please about how can I do this or What is the tool I can use without any errors or problems in this large streaming ?Thank you in advance,:)
23 Feb 2011 by #realJSOP
There is no such thing as a problem-free tool - for anything. Beyond that, video conferencing with THAT many people is going to be problematic for everyone, with the biggest problems being faced by the connected site that has the lowest bandwidth.Google "web-based video conferencing" for...
23 Feb 2011 by Michael Waguih
Hi all,I will have a meeting after 2 weeks and I want to post a live streaming on the web for this meeting for others outside to view this meeting.Please I want to know what should I have and what should I do for doing such thing?Thanks in advance,:)
23 Feb 2011 by Abhinav S
This[^] may be of some assistance to you.
5 May 2011 by 555336
Ok, I posted this earlier but seems no one has understood me, now I will give a simple eich have the word "love" must appear in the another multiline textbox.I have a simple streamreader code, but its not that Im searching. Im new in Visual basic, please help!
25 Mar 2011 by CPallini
Modify the 'simple streamreader' code you have:Read the text a line at time.Search for the given word inside the read line.If the line contains word then add it to the multiline textbox.
6 Apr 2011 by Sandeep Mewara
I am sorry but there is no quick question here. This looks like your college assignment, you should put some effort.We expect you to put some time in trying the issue that you are facing and then some time in formulating the question while posting here. Here is what is expected by...
30 Apr 2011 by OriginalGriff
If you try typing into your code, intellisense provides the answer:Dim sw As New StreamWriter("F:\Temp\dummy.txt", True)Place your cursor over the "True" and press CTRL+SHIFT+Space. Look at overload 4: string path, bool append. The text for append gives you a description of what happens when a...
2 May 2011 by Sergey Alexandrovich Kryukov
The solution exist: you first create an instance of System.IO.FileStream and then create a System.IO.StreamWriter based on that stream.The complete code sample is shown here:http://msdn.microsoft.com/en-us/library/system.io.filestream.aspx[^] (you can search for "Append" to see this...
11 May 2011 by JohnLBevan
That's great - thanks Rick!I've now updated my code as per your recommendation (included below), and it works perfectly. I'd not tried this as I thought the lock was owned by the file stream, so accessing the file from a different object would cause issues - nice to learn otherwise...
16 May 2011 by stebain
Think I've solved it...forced the null at the end of the expected size by putting in char * tmpDynamicArray = new char[r.numEntries + 1]; in_file.read(tmpDynamicArray, r.numEntries); tmpDynamicArray[ r.NumEntries ] = '\0'; sst = tmpDynamicArray;and it seems okay......
18 May 2011 by EscKey2004
How to store an IStream to a file via C#[^]
24 May 2011 by Sergey Alexandrovich Kryukov
Look for the following sample: http://us2.php.net/manual/en/ref.zip.php[^], search the sentence "very short version of function for unzipping files with folders structure".Find a lot more: http://en.lmgtfy.com/?q=%22unzip+a+folder%22+PHP[^].—SA
30 May 2011 by Member 7838027
hi! I want to save an html file to a specific path without a save file dialog. here's my code for saving the file with a savefile dialog:SaveFileDialog dialog = new SaveFileDialog();dialog.DefaultExt = "*.html";dialog.Filter = "WORD Document (*.html)|*.html";if...
30 May 2011 by Keith Barrow
First, as SAKryukov said, there is no need to convert to a byte array, although you might like to buffer using a byte array. The SaveFileDialog takes no part writing the file, other than providing a convenient way to create a stream. Get rid of your 1st if statement and change the...
7 Jun 2011 by Jpuckett
Serialize your dataset into JSON, take the JSOn string to a byte array, and append that byte string to the front of your file byte array using additional delimiters so you can strip it out on the WCF side.Result? Single IOStream passed with additional info inside the file itself.WCF...
17 Jun 2011 by Keith Barrow
You should take a look at this thread on StackOverflow:http://stackoverflow.com/questions/384931/how-do-i-get-an-icon-from-a-png-image[^]Personally, I'd convert the png to ico (the thread has a link to at tool to do that) as it is the path of least resistance, but it is always good to have...
7 Jul 2011 by H.Johnson
Hi all,I have render a report on WebService layer and send it to WinForm Application layer as an byte array. After getting the array on the Application Layer, I want to show a Open/Save/Cancel dialog like lots of web sites use and enable the users open or save this report. As I want to create...
7 Jul 2011 by Alexandru Ghiondea
How about this code:OpenFileDialog ofd = new OpenFileDialog();if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK){ var file = ofd.FileName; // Write your file using the filename provided}Alex
7 Jul 2011 by Sergey Alexandrovich Kryukov
There is not a ready-to-use combine Open/Save Dialog. It's enough look at the help MSDN pages for the library you use (Windows.Forms tagged) to see that there are two separate classes in each: SaveDialog and OpenDialog. There is never no a need for combined behavior, so using two separate...
10 Jul 2011 by TorstenH.
yeah I have one. Unfortunately it's stuck in some winamp-plugin. It will cost me one fortune of time to extract that - so you'd have to pay 2 fortunes for that!My Lost Streaming MP3 Article[] is a good point to start at.Winamp Plugin Developer WIKI[^] should bring some ideas on how to...
10 Jul 2011 by bolikej
Hi All,I am trying to find a way to return a programatically created pdf to the browser without saving the file on the server. My code creates a PDF object(I use the well known Aspose library for that)What i want now is rater than to save a file just return it as is back to the...
26 Jul 2011 by adnama
I am using this code: try { List result = new List(); System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); if...
26 Jul 2011 by Shameel
The constructor of the StreamReader class throws the exception. It means assembly.GetManifestResourceStream(defaultUsageProfilePath) is returning null.
26 Jul 2011 by BobJanova
Did you remember to add the default assembly to the front of the file name you are trying to retrieve? Load your assembly into a disassembler (ILDasm is fine) to find out what the resource is actually called, and make sure your string matches.The error is telling you the parameter to...
9 Aug 2011 by helldevil1912
I'm building a streaming video server. Now I must transfer sequence data (data packets) of a video file to client. But I don't know timer tick to transfer a data packet. If i transfer too fast, client don't have enough time to decode and display.I don't know whether it depend on Bitrate or other...
10 Aug 2011 by User 7427435
it is possible ,i can get stream from a asp:image control in asp.net?
6 Oct 2016 by UNOWN301
Hey guys, I have been doing some experimenting with WAV files and I need to be able to play an WAV file from a stream. What I am going to be doing is opening a file, getting the raw data of the wav file. I do this by using this class provided by...
23 Aug 2011 by Sergey Alexandrovich Kryukov
First of all, address this problem to the author of the article Nightfox. At the button of the article page, click "New Message" — the author will receive notification.—SA
20 Sep 2011 by ahsanriaz1K
Hi,Just read line by line and token it on space using arr = strtok(buffer,' ');check the correct syntax from internet.arr will have the words.
25 Oct 2011 by Jackie00100
hi im working on a simple IM chat messenger and every thing works fine as long as i sends a "controlled" amount of lines to the server but what i want is to let the user be able from the chat window to send multiple lines. at the moment im using readlines because i cant get .read or .write to...
25 Oct 2011 by BobJanova
NetworkStreams don't guarantee that one send = one receive. So you either need to add a delimiter which marks the end of a message, and buffer results until you reach it (ReadLine is doing this for you automatically), or you need to send a message header which includes the message length before...
10 Nov 2011 by Addy Tas
I'm not familiar with streaming video but instead of finding a calculated bit rate i'd first check if i would get buffer notifications of the client. E.g. Buffer 80% like serial ports can provide. Calculating the play rate may lead to glitches in your video presentation depending on the...
6 Dec 2011 by NguyenVanDuc
I have one video file,size 24MB, i want read from 12th MB to the end, how can i do it?
27 May 2018 by Vic91
I'm using sockets to create a chat simulation application using visual basic 2010. I've managed to make the connection work and send and receive data between two instances of my app. But when I close one of them, the other one starts getting the last received message and adding it to the message...
24 Feb 2012 by Dreamcooled
HiI've a problem with Unrar (called as C# process).(I know there are several implementations for C#, but the most of them are buggy or they haven't the functions I need.)As soon as I redirect one of the standard streams, Unrar skips all inputs (like passwort requests) and exits. But I...