Author: bodewig
Date: Sun Jan 19 06:49:22 2014
New Revision: 1559477
URL: http://svn.apache.org/r1559477
Log:
must be more specific about the direction of channels
Modified:
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/ArchiveFormat.java
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/spi/AbstractArchiveFormat.java
Modified:
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/ArchiveFormat.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/ArchiveFormat.java?rev=1559477&r1=1559476&r2=1559477&view=diff
==============================================================================
---
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/ArchiveFormat.java
(original)
+++
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/ArchiveFormat.java
Sun Jan 19 06:49:22 2014
@@ -19,7 +19,8 @@
package org.apache.commons.compress2.archivers;
import java.nio.ByteBuffer;
-import java.nio.channels.Channel;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
import java.nio.charset.Charset;
import java.io.File;
import java.io.IOException;
@@ -91,7 +92,8 @@ public interface ArchiveFormat<A extends
* @throws IOException
* @throws UnsupportedOperationException if this format cannot read from
non-seekable channels.
*/
- ArchiveInput<A> readFrom(Channel channel, Charset charset) throws
IOException, UnsupportedOperationException;
+ ArchiveInput<A> readFrom(ReadableByteChannel channel, Charset charset)
+ throws IOException, UnsupportedOperationException;
/**
* Reads an archive assuming the given charset for entry names.
* @param file the file to read from
@@ -121,7 +123,8 @@ public interface ArchiveFormat<A extends
* @throws UnsupportedOperationException if this format cannot write to
non-seekable channels or doesn't support
* writing at all.
*/
- ArchiveOutput<A> writeTo(Channel channel, Charset charset) throws
IOException, UnsupportedOperationException;
+ ArchiveOutput<A> writeTo(WritableByteChannel channel, Charset charset)
+ throws IOException, UnsupportedOperationException;
/**
* Writes an archive using the given charset for entry names.
* @param file the file to write to
Modified:
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/spi/AbstractArchiveFormat.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/spi/AbstractArchiveFormat.java?rev=1559477&r1=1559476&r2=1559477&view=diff
==============================================================================
---
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/spi/AbstractArchiveFormat.java
(original)
+++
commons/proper/compress/branches/compress-2.0/src/main/java/org/apache/commons/compress2/archivers/spi/AbstractArchiveFormat.java
Sun Jan 19 06:49:22 2014
@@ -23,7 +23,8 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
-import java.nio.channels.Channel;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.WritableByteChannel;
//import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.util.Collections;
@@ -100,7 +101,8 @@ public abstract class AbstractArchiveFor
* <p>This implementation always throws an
UnsupportedOperationException.</p>
*/
@Override
- public ArchiveInput<A> readFrom(Channel channel, Charset charset) throws
IOException, UnsupportedOperationException {
+ public ArchiveInput<A> readFrom(ReadableByteChannel channel, Charset
charset)
+ throws IOException, UnsupportedOperationException {
throw new UnsupportedOperationException("this format cannot read from
non-seekable channels");
}
/**
@@ -132,7 +134,8 @@ public abstract class AbstractArchiveFor
* <p>This implementation always throws an
UnsupportedOperationException.</p>
*/
@Override
- public ArchiveOutput<A> writeTo(Channel channel, Charset charset) throws
IOException, UnsupportedOperationException {
+ public ArchiveOutput<A> writeTo(WritableByteChannel channel, Charset
charset)
+ throws IOException, UnsupportedOperationException {
throw new UnsupportedOperationException("this format is read-only");
}
/**