Browse Source

Java client: ByteBuffer.clear supports higher JDK versions

pull/1950/head
Chris Lu 4 years ago
parent
commit
e72e3453e8
  1. 3
      other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java

3
other/java/client/src/main/java/seaweedfs/client/ByteBufferPool.java

@ -3,6 +3,7 @@ package seaweedfs.client;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -34,7 +35,7 @@ public class ByteBufferPool {
} }
public static synchronized void release(ByteBuffer obj) { public static synchronized void release(ByteBuffer obj) {
obj.clear();
((Buffer)obj).clear();
bufferList.add(0, obj); bufferList.add(0, obj);
} }

Loading…
Cancel
Save