You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Simon Kelly (Commented) (JIRA)" <ji...@apache.org> on 2012/04/03 11:30:31 UTC

[jira] [Commented] (HBASE-3444) Bytes.toBytesBinary and Bytes.toStringBinary() should be reversible

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

Simon Kelly commented on HBASE-3444:
------------------------------------

Also results in java.lang.StringIndexOutOfBoundsException in Bytes.toBytesBinary if the byte[] ends in a '\'

{code}
byte[] bytes = new byte[]{'a','b','c','\'};
Bytes.toBytesBinary(Bytes.toStringBinary(bytes));
{code}
                
> Bytes.toBytesBinary and Bytes.toStringBinary()  should be reversible
> --------------------------------------------------------------------
>
>                 Key: HBASE-3444
>                 URL: https://issues.apache.org/jira/browse/HBASE-3444
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>            Priority: Minor
>
> Bytes.toStringBinary() doesn't escape \.
> Otherwise the transformation isn't reversible
> byte[] a = {'\', 'x' , '0', '0'}
> Bytes.toBytesBinary(Bytes.toStringBinary(a)) won't be equal to a

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira