aboutsummaryrefslogtreecommitdiff
path: root/other/java/client/src
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-02-24 07:40:32 -0800
committerChris Lu <chris.lu@gmail.com>2021-02-24 07:40:37 -0800
commit1d848641d76879573c02dafe9bd6941b794c29af (patch)
treeabefee23563659b4ca2941e4c6f3e55eb6f3f9b8 /other/java/client/src
parentd3a71966352ab7397813c8287ed12bcbdde0680e (diff)
downloadseaweedfs-1d848641d76879573c02dafe9bd6941b794c29af.tar.xz
seaweedfs-1d848641d76879573c02dafe9bd6941b794c29af.zip
Java client: ByteBuffer.clear supports higher JDK versions
fix https://github.com/chrislusf/seaweedfs/issues/1836
Diffstat (limited to 'other/java/client/src')
-rw-r--r--other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java b/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
index b73e99e69..ba298a713 100644
--- a/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
+++ b/other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java
@@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.OutputStream;
+import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.util.concurrent.*;
@@ -217,7 +218,7 @@ public class SeaweedOutputStream extends OutputStream {
private synchronized int submitWriteBufferToService(final ByteBuffer bufferToWrite, final long writePosition) throws IOException {
- bufferToWrite.flip();
+ ((Buffer)bufferToWrite).flip();
int bytesLength = bufferToWrite.limit() - bufferToWrite.position();
if (threadExecutor.getQueue().size() >= maxConcurrentRequestCount) {