[ 
https://issues.apache.org/jira/browse/HBASE-7137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495955#comment-13495955
 ] 

stack commented on HBASE-7137:
------------------------------

Nice patch.  Nice tests.

In toBytes, we do dup.postion(0) but we don't do this when we do getBytes.  
Should we?   Should getBytes make use of toBytes?

Thanks.
                
> Improve Bytes to accept byte buffers which don't allow us to directly access 
> thier backed arrays
> ------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-7137
>                 URL: https://issues.apache.org/jira/browse/HBASE-7137
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Hiroshi Ikeda
>            Priority: Minor
>         Attachments: HBASE-7137.patch
>
>
> Inside HBase, it seems that there is the implicit assumption that byte 
> buffers have backed arrays and are not read-only, and we can freely call 
> ByteBuffer.array() and arrayOffset() without runtime exceptions.
> But some classes, including Bytes, are supposed to be used by users from 
> outside of HBase, and we should think the possibility that methods receive 
> byte buffers which don't hold the assumption.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to