I/O, Streams & HTTP
Build honest byte pipelines, own stream lifetimes, and test bounded HTTP contracts entirely offline.
- Stream position, length and end-of-input
Track a cursor without assuming every stream supports seeking.
Stream foundations · 22 min - Short reads and ReadExactly
A successful Read can return fewer bytes than the buffer requested.
Stream foundations · 22 min - Buffer capacity is not payload length
Process only the bytes that the read operation actually initialized.
Stream foundations · 22 min - An explicit binary format and byte order
Write fixed-width values and inspect their actual bytes before assuming interoperability.
Stream foundations · 22 min - StreamReader, UTF-8 and BOM detection
Decode through a text reader with explicit encoding and ownership choices.
Stream foundations · 22 min - Wrapper disposal and leaveOpen
A reader or writer can own the stream it wraps, so choose the lifetime deliberately.
Stream foundations · 22 min - Encoding fallback is a data-quality policy
Choose whether malformed UTF-8 is replaced or rejected.
Stream foundations · 22 min - GZip with a bounded classroom payload
Finish compression before reading the container and bound the demonstrated output.
Bounded data · 22 min - SHA-256 hashes bytes, not intent
Use a supported digest API without confusing integrity with password storage or authentication.
Bounded data · 22 min - Cancellation-aware asynchronous copying
Pass the token through the copy and do not mistake cancellation for rollback.
Bounded data · 22 min - A reusable HttpClient with an offline handler
Exercise actual HTTP message APIs without sending any public request.
HTTP contracts · 22 min - Success status is not a response-body schema
Treat 204 as a successful no-content outcome and handle non-success status deliberately.
HTTP contracts · 22 min - Validate HTTP media type and JSON shape
A successful response still needs representation and domain checks.
HTTP contracts · 22 min - URI composition, query values and trailing slashes
Compose structure separately from escaped data and verify the resulting address.
HTTP contracts · 22 min - Stream an HTTP body with an application byte limit
Read incrementally while keeping the response alive and validating actual bytes consumed.
HTTP contracts · 22 min - Cancellation across the HTTP boundary
Forward the same owning token into transport and content operations.
HTTP contracts · 22 min - Bounded HTTP retries and idempotency
Retry one named transient status under a deliberate attempt budget.
HTTP contracts · 22 min - File paths are portable data, not filesystem permission
Explore path composition without pretending a browser lab touched the user’s disk.
Portable pipelines · 22 min - Incremental line processing with explicit record limits
Read text asynchronously while recognizing what the chosen limit does not bound.
Portable pipelines · 22 min - Capstone: bounded offline HTTP import
Combine status, media type, byte limits and validated model construction.
Portable pipelines · 22 min