Results for “Stream transformations”
Small, practical examples. Search by task or narrow things down below.
Write and read typed binary fields
Java: Data streams use a matching write/read order and fixed encodings for Java primitive values.
Java✓ Tested
Write several messages through one file descriptor
Bash Scripts: Open a destination once and close the descriptor after writing.
Bash Scripts✓ Tested
Append text to a file
Open a C++ stream in append mode and verify the write.
C++✓ Tested
Construct a record with named properties
PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.
PowerShell✓ Tested
Define a function with a typed parameter
Accept a name and return a greeting.
function✓ Tested
Filter even numbers
Use a Java stream to collect only even values.
Java✓ Tested
Join strings with a separator
Use an output string stream to join C++ values without a trailing separator.
C++✓ Tested
List regular files
List immediate regular files in sorted order and close the Java directory stream.
Java✓ Tested
Read a decimal number from serial input
Arduino / C: parseFloat parses a signed decimal value from the input stream.
Arduino / C✓ Tested
Sum integer values
Reduce a Java integer stream to its sum.
Java✓ Tested
Visit files recursively
Java: Close the stream returned by Files.walk and sort relative paths for stable output.
Java✓ Tested
Write a text file
Write and close a C++ output file while checking stream failure.
C++✓ Tested