Results for “stream”
Small, practical examples. Search by task or narrow things down below.
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
Write and read bytes without text conversion
C++: Use binary stream modes and check each I/O operation before consuming its result.
C++✓ Tested