Watch
2
0
Fork
You've already forked wendover
0
Java NIO channel tools
  • Java 99.9%
  • CSS 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mark Raynsford cee654b891
Some checks are pending
main-RHEL10-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL10-x86_64-jdk26 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk25 / Build (push) Waiting to run
main-RHEL9-x86_64-jdk26 / Build (push) Waiting to run
Update workflows.
2026-07-31 18:43:01 +01:00
.forgejo Update workflows. 2026-07-31 18:43:01 +01:00
com.io7m.wendover.core Begin next development iteration. 2026-05-03 16:24:14 +01:00
com.io7m.wendover.tests Begin next development iteration. 2026-05-03 16:24:14 +01:00
src/site/resources Update site metadata. 2025-08-09 15:07:20 +00:00
.gitignore Update .gitignore. 2024-05-07 16:01:48 +00:00
.gitmodules Move to new organization. 2024-05-02 09:23:53 +00:00
checkstyle-filter.xml Add extra channel implementations 2022-04-19 21:34:58 +00:00
checkstyle-suppressions-1.0.dtd Initial version 2022-04-19 18:00:43 +00:00
doc7m-books.json Add doc7m-books.json 2026-07-31 18:36:51 +01:00
pom.xml Migrate project. 2026-06-27 10:14:39 +01:00
README-CHANGES.xml Release: com.io7m.wendover 1.1.1 2026-05-03 16:24:12 +01:00
README-LICENSE.txt Update LICENSE 2023-08-13 21:16:12 +00:00
README.in Migrate project. 2026-06-27 10:14:39 +01:00
README.md Migrate project. 2026-06-27 10:14:39 +01:00

wendover

Maven Central Maven Central (snapshot) Java Version

com.io7m.wendover

wendover

The wendover package provides extra classes for working with Java NIO channels.

Features

  • Numerous Channel classes and adapters with various properties.
  • High coverage test suite.
  • OSGi-ready.
  • JPMS-ready.
  • ISC license.

Usage

CloseShieldSeekableByteChannel

Use CloseShieldSeekableByteChannel in order to prevent external code from closing an arbitrary SeekableByteChannel instance:

SeekableByteChannel c;

someUntrustedObject.run(new CloseShieldSeekableByteChannel(c));

The CloseShieldSeekableByteChannel instance can be closed, but will not result in the underlying channel really being closed.

ReadOnlySeekableByteChannel

Use ReadOnlySeekableByteChannel to protect an arbitrary SeekableByteChannel instance against writes:

SeekableByteChannel c;

someUntrustedObject.run(new ReadOnlySeekableByteChannel(c));

Attempts to write to the ReadOnlySeekableByteChannel will result in NonWritableChannelException being thrown.

SubrangeSeekableByteChannel

Use SubrangeSeekableByteChannel to restrict reads and writes to an arbitrary SeekableByteChannel instance to a particular range:

SeekableByteChannel c;

someObject.run(new SubrangeSeekableByteChannel(c, 100L, 1000L));

Reads of the SubrangeSeekableByteChannel instance will be limited to only reading data that falls within offsets [100, 100 + 1000 - 1]. Reading at position 0 of the SubrangeSeekableByteChannel instance will actually read from position 100 of c. Writes are similarly translated and limited.

UpperRangeTrackingSeekableByteChannel

Use UpperRangeTrackingSeekableByteChannel to track the uppermost point written by an arbitrary SeekableByteChannel instance:

SeekableByteChannel c;

var d = new UpperRangeTrackingSeekableByteChannel(c);

someObject.run(d);

System.out.println(d.uppermostWritten());

ByteBufferChannels

Use the ByteBufferChannels class to adapt a ByteBuffer into a SeekableByteChannel:

ByteBuffer data;

SeekableByteChannel c = ByteBufferChannels.ofByteBuffer(data);

DelegatingSeekableByteChannel

Use the DelegatingSeekableByteChannel class to delegate operations to an existing channel. This class is used to implement most of the wendover package.