szetszwo commented on PR #10536:
URL: https://github.com/apache/ozone/pull/10536#issuecomment-4928032093

   > When ChunkBuffer allocates heap buffer UnsafeByteOperations.unsafeWrap() 
returns a BoundedByteString ...
   
   For direct buffer, UnsafeByteOperations.unsafeWrap returns NioByteString but 
not BoundedByteString.
   
   - Output:
   ```
   class org.apache.ratis.thirdparty.com.google.protobuf.NioByteString
   class com.google.protobuf.NioByteString
   ```
   ```java
     public static void main(String[] args) {
       final ByteBuffer buffer = ByteBuffer.allocateDirect(4);
       buffer.putInt(0);
       System.out.println(UnsafeByteOperations.unsafeWrap(buffer).getClass());
       
System.out.println(com.google.protobuf.UnsafeByteOperations.unsafeWrap(buffer).getClass());
     }
   ```


-- 
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]

Reply via email to