diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-24 07:40:32 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-24 07:40:37 -0800 |
| commit | 1d848641d76879573c02dafe9bd6941b794c29af (patch) | |
| tree | abefee23563659b4ca2941e4c6f3e55eb6f3f9b8 /other/java | |
| parent | d3a71966352ab7397813c8287ed12bcbdde0680e (diff) | |
| download | seaweedfs-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')
| -rw-r--r-- | other/java/client/src/main/java/seaweedfs/client/SeaweedOutputStream.java | 3 |
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) { |
