Skip to content

Commit

Permalink
If compiled with Java 11, still work on Java 8. (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey committed Feb 29, 2024
1 parent 16e6311 commit 1f46a9b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import java.io.IOException;
import java.net.Socket;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Collections;
Expand Down Expand Up @@ -139,7 +140,7 @@ void flushOut(Wire out) {
return;
ByteBuffer bb = bytes.underlyingObject();
assert bb != null;
bb.position(Math.toIntExact(bytes.readPosition()));
((Buffer)bb).position(Math.toIntExact(bytes.readPosition()));
bb.limit(Math.toIntExact(bytes.readLimit()));
while (bb.remaining() > 0) {
int len;
Expand Down

0 comments on commit 1f46a9b

Please sign in to comment.