Course · 20 lessons

I/O, Streams & HTTP

Build honest byte pipelines, own stream lifetimes, and test bounded HTTP contracts entirely offline.

  1. Stream position, length and end-of-input

    Track a cursor without assuming every stream supports seeking.

    Stream foundations · 22 min
  2. Short reads and ReadExactly

    A successful Read can return fewer bytes than the buffer requested.

    Stream foundations · 22 min
  3. Buffer capacity is not payload length

    Process only the bytes that the read operation actually initialized.

    Stream foundations · 22 min
  4. An explicit binary format and byte order

    Write fixed-width values and inspect their actual bytes before assuming interoperability.

    Stream foundations · 22 min
  5. StreamReader, UTF-8 and BOM detection

    Decode through a text reader with explicit encoding and ownership choices.

    Stream foundations · 22 min
  6. Wrapper disposal and leaveOpen

    A reader or writer can own the stream it wraps, so choose the lifetime deliberately.

    Stream foundations · 22 min
  7. Encoding fallback is a data-quality policy

    Choose whether malformed UTF-8 is replaced or rejected.

    Stream foundations · 22 min
  8. GZip with a bounded classroom payload

    Finish compression before reading the container and bound the demonstrated output.

    Bounded data · 22 min
  9. SHA-256 hashes bytes, not intent

    Use a supported digest API without confusing integrity with password storage or authentication.

    Bounded data · 22 min
  10. Cancellation-aware asynchronous copying

    Pass the token through the copy and do not mistake cancellation for rollback.

    Bounded data · 22 min
  11. A reusable HttpClient with an offline handler

    Exercise actual HTTP message APIs without sending any public request.

    HTTP contracts · 22 min
  12. 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
  13. Validate HTTP media type and JSON shape

    A successful response still needs representation and domain checks.

    HTTP contracts · 22 min
  14. URI composition, query values and trailing slashes

    Compose structure separately from escaped data and verify the resulting address.

    HTTP contracts · 22 min
  15. 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
  16. Cancellation across the HTTP boundary

    Forward the same owning token into transport and content operations.

    HTTP contracts · 22 min
  17. Bounded HTTP retries and idempotency

    Retry one named transient status under a deliberate attempt budget.

    HTTP contracts · 22 min
  18. 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
  19. Incremental line processing with explicit record limits

    Read text asynchronously while recognizing what the chosen limit does not bound.

    Portable pipelines · 22 min
  20. Capstone: bounded offline HTTP import

    Combine status, media type, byte limits and validated model construction.

    Portable pipelines · 22 min