szetszwo commented on pull request #2701:
URL: https://github.com/apache/ozone/pull/2701#issuecomment-946504887
```
public class StreamBuffer {
private final ByteBuffer buffer;
public StreamBuffer(ByteBuffer buffer) {
this.buffer = buffer.asReadOnlyBuffer();
}
public StreamBuffer(ByteBuffer buffer, int offset, int length) {
this((ByteBuffer)
buffer.asReadOnlyBuffer().position(offset).limit(offset + length));
}
public ByteBuffer duplicate() {
return buffer.duplicate();
}
public int length() {
return buffer.limit() - buffer.position();
}
}
```
We may create a new StreamBuffer as shown above. Then, we can use ==.
Tried it with the current change. It seems working; please test it:
https://issues.apache.org/jira/secure/attachment/13035081/StreamBuffer.patch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]