Questions tagged [stream]
A stream is a series of data elements (characters, bytes or complex packets) which can be accessed or made accessible in a serial fashion. Random access is not possible.
324 questions
9votes
2answers
577views
Transliterate wide-character input
One shortcoming of GNU's implementation of the tr utility is that it operates on bytes rather than characters. As the man page says under BUGS: Full support is ...
5votes
2answers
910views
An AsyncStreamWriter that allows to asynchronously write to a Stream
I'm hoping this should be mostly asynchronous, looking to make this close to 100%, if not 100%, so. This class was created to ease converting image formats, but it has an unlimited number of use cases....
1vote
0answers
34views
Optimizing MJPEG stream handling in Service Worker
Background: I'm implementing a small react app in which an MJPEG stream transmitted by HTTPS is displayed. The stream is only accessible if the user is authorized (using Basic Auth). Therefore, I can ...
0votes
0answers
24views
Powershell function which communicates over TCP to a Zebra printer
I have a Powershell function that communicates over TCP to a Zebra printer: ...
6votes
4answers
894views
Very simple CSV-parser in Java
Please take a look at my method for parsing a CSV string. I am looking for a simple approach without using an external library. Is throwing a RuntimeException ...
4votes
6answers
422views
Search values by priority in a Stream
I have a simple list of results, and I need to return only one value depending on content, for example: ...
4votes
1answer
415views
Java: Benchmark findFirst() and findAny() methods on non-parallel streams
I would like to know how representative the following benchmark is? Can we infer from it that findFirst is much slower than ...
6votes
2answers
364views
To markup a C++ std::ostream and delegate formatting of markuped text
I want to create a system that marks up text with tags inserted into a stream. Each tag frames a part of the text, creating a tree-like structure, just as in classic markup languages (HTML, XML...). I ...
1vote
2answers
109views
Python - streaming file
I need to download and upload around 1000 files. The file is first downloaded from one webserver and then uploaded to another. My first approach was to save each file on disk and then upload - but as ...
3votes
1answer
101views
In Java, replace for loop with condition with lambdas [closed]
I want to replace a for loop with a break/return condition inside with a lambda. I think I have a good replacement, but I want ...
5votes
2answers
285views
ostream that counts and discards the characters written to it
The code below implements a class, CountingOStream, whose job is to count the number of characters written to it while also discarding those characters and ...
3votes
1answer
317views
Implementation of java.util.stream.Stream (and friends) that reads lines from the internet without requiring you to manage the resources
This streams lines of information over the internet using BufferedReader::lines. However, what makes this special (and thus, extraordinarily complicated imo) is ...
4votes
1answer
121views
Video transcoding using ffmpeg
I am transcoding video to different quality using ffmpeg using subprocess in Python. I want to make my transcoding faster. I tried multi-threading but it didn't help. Hardware acceleration is not ...
2votes
2answers
111views
Find all line numbers of prefix duplicates with streams
All line indices of lines from a text that begin with the same line prefix should be found. The prefixes and the corresponding line numbers should be returned. Streams and lambdas should be used as ...
5votes
2answers
161views
Print the three most occurring chars in Java using streams
The three characters that occurs most in a given string should be printed by using streams/lambdas (functional programming). The order of characters that occur equally often should be preserved. My ...