Results for “stream”
Small, practical examples. Search by task or narrow things down below.
Append a stream to a log file
Linux Commands: Use tee -a to preserve existing log contents.
Linux Commands✓ Tested
Calculate several numeric stream statistics
Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.
Java✓ Tested
Capture a command’s success-stream output
PowerShell: Assignment collects output values without requiring text redirection to a file.
PowerShell✓ Tested
Check any and all stream elements
Java: Use short-circuiting match operations for predicates over a Java collection.
Java✓ Tested
Check the integrity of a gzip stream
Linux Commands: Use gzip -t to verify a compressed file without extracting it.
Linux Commands✓ Tested
Compare two generated sorted streams
Bash Scripts: Process substitution lets a command consume another command’s output as a file-like input.
Bash Scripts✓ Tested
Compress a stream to a chosen filename
Linux Commands: Use gzip -c to leave the source file untouched and choose the destination explicitly.
Linux Commands✓ Tested
Copy a stream and count its bytes
Copy a stream and count its bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Find the first matching stream value
Java: Use findFirst and an explicit default for an empty result.
Java✓ Tested
Handle a failed file open through stream state
C++: An unopened input stream is not an empty successful file read.
C++✓ Tested
Join transformed stream values
Java: Use Collectors.joining after converting elements to strings.
Java✓ Tested
Limit the bytes read from a stream
Limit the bytes read from a stream using a complete Go program with explicit sample inputs.
Go✓ Tested