FIND YOUR NEXT FEW LINES

Results for “stream”

Small, practical examples. Search by task or narrow things down below.

56 snippets foundClear filters
Linux CommandsStreams & byte tools

Encode and decode a file with Base64

Linux Commands: Use GNU base64 for text transport of bytes and --decode for the reverse operation.

Linux Commands✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
JavaStream transformations

Group strings by their length

Java: Choose a TreeMap supplier when group keys must have deterministic order.

Java✓ Tested
JavaStream transformations

Index records by a unique key

Java: Use toMap with an explicit merge rule so duplicate keys have defined behavior.

Java✓ Tested
Linux CommandsStreams & byte tools

Inspect bytes as hexadecimal values

Linux Commands: Use od with explicit formatting and no address column.

Linux Commands✓ Tested
JavaStream transformations

Partition a collection by a predicate

Java: Use partitioningBy to retain both matching and nonmatching values.

Java✓ Tested
Bash ScriptsInput streams & redirection

Pass a variable to standard input

Bash Scripts: A here-string supplies the expanded value followed by a newline.

Bash Scripts✓ Tested
GitRemotes & collaboration

Pull without creating a merge commit

Update a branch only when its upstream can be fast-forwarded.

pull✓ Tested
Linux CommandsStreams & byte tools

Read a byte prefix

Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.

Linux Commands✓ Tested
Linux CommandsStreams & byte tools

Read a byte suffix

Linux Commands: Use GNU tail -c to extract a fixed-size ending.

Linux Commands✓ Tested
Bash ScriptsInput streams & redirection

Read complete lines into an array

Bash Scripts: Mapfile with -t removes each line terminator but preserves other whitespace.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Read from a dedicated file descriptor

Bash Scripts: An explicitly opened descriptor keeps the script’s ordinary standard input available.

Bash Scripts✓ Tested