You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2025/01/22 09:39:08 UTC
(sis) 03/04: Relax the interface implemented by `ByteRangeChannel`. This is for making easier to implement wrappers around other channels that are not sure to be seekable.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit fbaf9c4b0c559a51e73a499567b276805115df15
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Jan 8 15:40:40 2025 +0100
Relax the interface implemented by `ByteRangeChannel`.
This is for making easier to implement wrappers around other channels that are not sure to be seekable.
---
.../main/org/apache/sis/io/stream/ByteRangeChannel.java | 4 ++--
.../main/org/apache/sis/io/stream/FileCacheByteChannel.java | 2 +-
.../main/org/apache/sis/gui/internal/io/FileAccessItem.java | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/ByteRangeChannel.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/ByteRangeChannel.java
index b1bbd433af..dda48b613a 100644
--- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/ByteRangeChannel.java
+++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/ByteRangeChannel.java
@@ -16,7 +16,7 @@
*/
package org.apache.sis.io.stream;
-import java.nio.channels.SeekableByteChannel;
+import java.nio.channels.ReadableByteChannel;
/**
@@ -24,7 +24,7 @@ import java.nio.channels.SeekableByteChannel;
*
* @author Martin Desruisseaux (Geomatys)
*/
-public abstract class ByteRangeChannel implements SeekableByteChannel {
+public abstract class ByteRangeChannel implements ReadableByteChannel {
/**
* Creates a new channel.
*/
diff --git a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/FileCacheByteChannel.java b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/FileCacheByteChannel.java
index 25e49f3d3f..cb9e13b396 100644
--- a/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/FileCacheByteChannel.java
+++ b/endorsed/src/org.apache.sis.storage/main/org/apache/sis/io/stream/FileCacheByteChannel.java
@@ -56,7 +56,7 @@ import static org.apache.sis.storage.base.StoreUtilities.LOGGER;
*
* @author Martin Desruisseaux (Geomatys)
*/
-public abstract class FileCacheByteChannel extends ByteRangeChannel {
+public abstract class FileCacheByteChannel extends ByteRangeChannel implements SeekableByteChannel {
/**
* Size of the transfer buffer, in number of bytes.
* This value does not need to be as large as {@link StorageConnector#DEFAULT_BUFFER_SIZE}
diff --git a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/io/FileAccessItem.java b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/io/FileAccessItem.java
index b75534d335..aac4718f7b 100644
--- a/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/io/FileAccessItem.java
+++ b/optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/io/FileAccessItem.java
@@ -419,7 +419,7 @@ final class FileAccessItem implements Runnable, EventHandler<ActionEvent> {
/**
* Wrapper around a {@link SeekableByteChannel} which will observe the ranges of bytes read or written.
*/
- final class Observer extends ByteRangeChannel {
+ final class Observer extends ByteRangeChannel implements SeekableByteChannel {
/**
* The channel doing the actual read or write operations.
*/