Results for “Streams & byte tools”
Small, practical examples. Search by task or narrow things down below.
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
Measure the byte length of UTF-8 text
C#: Character count and encoded byte count can differ for non-ASCII text.
C#✓ Tested
Measure UTF-8 bytes separately from characters
Java: Encode a Java string before measuring its serialized byte length.
Java✓ Tested
Move overlapping bytes safely
C: memmove supports overlapping ranges, unlike memcpy.
C✓ Tested
Pack two small values into one byte
Arduino / C: Mask each four-bit value before combining it.
Arduino / C✓ Tested
Read a big-endian integer from bytes
Java: Set a byte order explicitly when handling a binary protocol.
Java✓ Tested
Read a big-endian integer from bytes
Read a big-endian integer from bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Read a byte lookup table from flash
Arduino / C: PROGMEM tables require the AVR program-memory access functions.
Arduino / C✓ Tested
Read a file length in bytes
Java: Files.size inspects metadata without loading the file into a Java string.
Java✓ Tested
Read a file size in bytes
Python: Use stat().st_size to read the logical byte length without loading the file.
Python✓ Tested
Read a file size in bytes
PowerShell: The Length property of a file item reports its logical byte size.
PowerShell✓ Tested
Read a little-endian integer from bytes
Read a little-endian integer from bytes in a complete Rust program using the standard library.
Rust✓ Tested