Results for “JSON & binary formats”
Small, practical examples. Search by task or narrow things down below.
Create and clean up a temporary file
Java: Create a unique file and remove it in finally even when the operation fails.
Java✓ Tested
Delete a known temporary file if present
Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.
Java✓ Tested
Encode a value as little-endian bytes
Arduino / C: Store the least significant byte first when the protocol requires it.
Arduino / C✓ Tested
Encode and decode Base64 text
Encode and decode Base64 text using a complete Go program with explicit sample inputs.
Go✓ Tested
Encode and decode UTF-8 text with Base64
PowerShell: Convert the string to bytes explicitly before Base64 encoding.
PowerShell✓ Tested
Encode bytes as hexadecimal
Encode bytes as hexadecimal using a complete Go program with explicit sample inputs.
Go✓ Tested
Escape a single URL parameter value
PowerShell: EscapeDataString encodes one value without treating it as a complete URL.
PowerShell✓ Tested
Escape plain text before placing it in HTML
PowerShell: HtmlEncode converts HTML delimiters to entities in ordinary text contexts.
PowerShell✓ Tested
Extract the low and high byte of a value
Arduino / C: lowByte and highByte expose the two bytes of a 16-bit value.
Arduino / C✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Locate a value in a sorted array
Java: Use Arrays.binarySearch only after establishing ascending order.
Java✓ Tested
Move a file to a new name
Java: Files.move changes the path and returns the destination Path.
Java✓ Tested