Skip to content

Added functions for extention functions for Input/Output streams#10

Merged
DeveloprOfThings merged 1 commit intomainfrom
add-input-output-stream-extensions
Mar 19, 2026
Merged

Added functions for extention functions for Input/Output streams#10
DeveloprOfThings merged 1 commit intomainfrom
add-input-output-stream-extensions

Conversation

@DeveloprOfThings
Copy link
Owner

  • Introduced ExperimentalKapacityApi annotation to mark experimenta…l Kapacity APIs.
  • Added Kapacity.INVALID sentinel value (equivalent to -1L) to represent invalid, missing, or exhausted capacity, particularly for I/O operations.
  • Added InputStream.available extension property to return available bytes as a Kapacity instance.
  • Added InputStream.read and InputStream.readKapacity extension functions to safely read data into a ByteArray using Kapacity to limit length and prevent buffer overflows.
  • Added OutputStream.write extension function to write data from a ByteArray to a stream with Kapacity bounds checking and clamping.
  • Included comprehensive unit tests for new InputStream and OutputStream extensions in kapacity-io.
  • Incremented project version to 0.9.9-beta09.

…l Kapacity APIs.

- Added `Kapacity.INVALID` sentinel value (equivalent to `-1L`) to represent invalid, missing, or exhausted capacity, particularly for I/O operations.
- Added `InputStream.available` extension property to return available bytes as a `Kapacity` instance.
- Added `InputStream.read` and `InputStream.readKapacity` extension functions to safely read data into a `ByteArray` using `Kapacity` to limit length and prevent buffer overflows.
- Added `OutputStream.write` extension function to write data from a `ByteArray` to a stream with `Kapacity` bounds checking and clamping.
- Included comprehensive unit tests for new `InputStream` and `OutputStream` extensions in `kapacity-io`.
- Incremented project version to `0.9.9-beta09`.
@DeveloprOfThings DeveloprOfThings self-assigned this Mar 19, 2026
@DeveloprOfThings DeveloprOfThings merged commit 8aa7b56 into main Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant