The GitHub Actions job "Java CI" on commons-io.git/master has failed.
Run started by GitHub user garydgregory (triggered by garydgregory).

Head commit for run:
8080c7cb26b357598c636fc50f52a76995d2949b / Piotr P. Karwasz 
<[email protected]>
Add NIO channel support to `AbstractStreamBuilder` (#784)

* feat: add NIO channel support to `AbstractStreamBuilder`

Some builders derived from `AbstractStreamBuilder` (for example, 
`SevenZFile.Builder` in Commons Compress) need to produce a 
`SeekableByteChannel` as their data source. Until now this required ad-hoc 
`instanceof` switches across different origin types.

This change integrates channel support directly into the origin/builder 
abstraction, leading to a cleaner and more object-oriented design.

### Key changes

* Add `getReadableByteChannel()` and `getWritableByteChannel()` to 
`AbstractOrigin` and propagate to `AbstractStreamBuilder`.
* Introduce `ChannelOrigin`, an `AbstractOrigin` implementation backed by an 
existing `ReadableByteChannel`/`WritableByteChannel`.
* Add `ByteArrayChannel`, a simple in-memory `SeekableByteChannel` 
implementation.
* Extend unit tests to cover the new methods and types.

* fix: cleanup on Windows

* fix: checkstyle violation

* fix: merge `ByteArrayChannel` and `ByteArraySeekableByteChannel`

* fix: failing test

* fix: remove irrelevant changes

* fix: changelog

* fix: make `data` private

* fix: refine `ByteArraySeekableByteChannel` Javadoc

Clarifies the Javadoc to better reflect the intended usage patterns:

* `wrap(byte[])` is modeled after `ByteArrayInputStream` and is primarily for 
read-oriented use.
* The public constructors `ByteArraySeekableByteChannel()` and 
`ByteArraySeekableByteChannel(int)` follow the pattern of 
`ByteArrayOutputStream` and are mainly suited for write-oriented use.

* fix: add missing `@Override` annotation

* fix: typo in default size value

* feat: add generic `getChannel(Class<C>)` accessor

Adds a type-safe `getChannel(Class<C>)` method that lets callers request any 
supported `Channel` subtype (e.g. `ReadableByteChannel`, `WritableByteChannel`, 
`SeekableByteChannel`) through a single entry point.

* fix: rename `doGetChannel` to `getChannel`

* fix: Javadoc

* fix: default capacity of `ByteArraySeekableByteChannel`

* fix: rename `getTestData` to `cloneTestData`

* docs: minimum channel type by origin

* fix: make `getChannel` final

* fix: don't clone `testData`

Cloning the test data is unnecessary as all but one test are not supposed to 
modify them.

* fix: test order

Report URL: https://github.com/apache/commons-io/actions/runs/18047078517

With regards,
GitHub Actions via GitBox

Reply via email to