tagged [stream]

Closing streams, always necessary? .net

Closing streams, always necessary? .net Is it always necessary to close streams or, because .net is managed code, will it be closed automatically as soon as it drops out of scope (assuming there are n...

1 Mar at 22:42

Save byte array to file

Save byte array to file I have a byte array (an IEnumerable actually), and I need to save it to a new file containing this data. How do I do that? I found some answers telling how to create a MemorySt...

18 Oct at 17:11

How to add elements of a Java8 stream into an existing List

How to add elements of a Java8 stream into an existing List [Javadoc of Collector](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collector.html) shows how to collect elements of a stream ...

11 Jan at 06:10

How to read and modify NTFS Alternate Data Streams using .NET

How to read and modify NTFS Alternate Data Streams using .NET How can I read and modify "NTFS Alternate Data Streams" using .NET? It seems there is no native .NET support for it. Which Win32 API's wou...

29 Jul at 20:27

Stream.Length throws NotSupportedException

Stream.Length throws NotSupportedException I am getting a error when attempting stream.Length on a Stream object sent into my WCF method. How do you get the length of the stream? any ex

30 Jul at 16:41

"Parameter not valid" exception loading System.Drawing.Image

"Parameter not valid" exception loading System.Drawing.Image Why am I getting the exception "Parameter not valid" in my code: The length of `byteArrayIn` is 169014. I am getting this exception despite...

23 Jan at 19:25

Write StringBuilder to Stream

Write StringBuilder to Stream What is the best method of writing a StringBuilder to a System.IO.Stream? I am currently doing: ``` StringBuilder message = new StringBuilder("All your base"); message.Ap...

10 Feb at 11:34

Java 8 method references: provide a Supplier capable of supplying a parameterized result

Java 8 method references: provide a Supplier capable of supplying a parameterized result I'd like to use with an Exception type that asks for a constructor parameter. Something like this: Is there a w...

10 Jun at 13:45

What are some practical problems that parallel computing, f#, and GPU-parallel processing might solve

What are some practical problems that parallel computing, f#, and GPU-parallel processing might solve [Recently WiFi encryption was brute forced by using the parellel processing power of the modern GP...

Best way to find position in the Stream where given byte sequence starts

Best way to find position in the Stream where given byte sequence starts How do you think what is the best way to find position in the System.Stream where given byte sequence starts (first occurence):...

24 Sep at 14:17

Merge lists with stream API

Merge lists with stream API I have the following situation I have to merge all the lists `lst` from the `ListContainer` objects from a `Map` map. Any idea how, using Java 8 s

2 Sep at 09:44

Ignore duplicates when producing map using streams

Ignore duplicates when producing map using streams I get `java.lang.IllegalStateException: Duplicate key` when a duplicated element is found. Is it possible to ignore such exception on adding v

12 May at 09:50

C# using streams

C# using streams Streams are kind of mysterious to me. I don't know when to use which stream and how to use them. Can someone explain to me how streams are used? If I understand correctly, there are t...

24 Oct at 04:33

Write Unicode String In a File Using StreamWriter doesn't Work

Write Unicode String In a File Using StreamWriter doesn't Work I have this code: but when I run it I can't see any "آ" in a.txt!! There isn't any string in a.txt! It is Empty! What is problem!?! Can a...

3 Jul at 20:58

ReadAllLines for a Stream object?

ReadAllLines for a Stream object? There exists a `File.ReadAllLines` but not a `Stream.ReadAllLines`. Do

9 Nov at 17:23

What's the difference between map() and flatMap() methods in Java 8?

What's the difference between map() and flatMap() methods in Java 8? In Java 8, what's the difference between [Stream.map()](http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#map-j...

26 Nov at 14:38

Convert to Stream from a Url

Convert to Stream from a Url I was trying to convert an Url to Stream but I am not sure whether I am right or wrong. ``` protected Stream GetStream(String gazouUrl) { Stream rtn = null; HttpWebReq...

24 Jun at 02:56

Can i put binary in stdin? C#

Can i put binary in stdin? C# Related to this question [encrypt binary with 7z without filenames?](https://stackoverflow.com/questions/1284088/encrypt-binary-with-7z-without-filenames/1284101#1284101)...

23 May at 10:32

PDFsharp save to MemoryStream

PDFsharp save to MemoryStream I want to save a PdfSharp.Pdf.PdfDocument by its 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 i...

30 Jun at 07:57

When to use TcpClient.ReceiveTimeout vs. NetworkStream.ReadTimeout?

When to use TcpClient.ReceiveTimeout vs. NetworkStream.ReadTimeout? When programming a TCP server I would like to set the timeout period for reading the request from the client: See the last two lines...

22 May at 07:45

Do you need to call Flush() on a stream or writer if you are using the “using” statement?

Do you need to call Flush() on a stream or writer if you are using the “using” statement? I am not sure whether I need to call `Flush()` on the used objects if I write something like this: Are they al...

24 Jan at 10:22

How to ensure order of processing in java8 streams?

How to ensure order of processing in java8 streams? I want to process lists inside an `XML` java object. I have to ensure processing all elements in order I received them. Should I therefore call `seq...

25 Mar at 07:10

Convert a Stream to a FileStream in C#

Convert a Stream to a FileStream in C# What is the best method to convert a Stream to a FileStream using C#. The function I am working on has a Stream passed to it containing uploaded data, and I need...

17 Mar at 16:7

Checking if a stream is empty

Checking if a stream is empty I am trying to deserialize a XML-file. I need to check if the XML-file stream is empty before tying to deserialize it. ``` IsolatedStorageFileStream isfs1 = new IsolatedS...

30 May at 19:12

Java 8, Streams to find the duplicate elements

Java 8, Streams to find the duplicate elements I am trying to list out duplicate elements in the integer list say for eg, using Streams of jdk 8. Has anybody tried out. To remove the duplicates we can...

13 Aug at 02:48