You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Hari Sreekumar <hs...@clickable.com> on 2011/05/26 17:03:52 UTC

Using java's getBytes() vs using Bytes.getBytes()

Hi,

I have seen people using java's native .toBytes() function without any
problems which converting tablenames etc. to bytes. I would just like to
confirm if using java's native toBytes() is fine. Is there a possibility
that the HBase byte conversion codec might change in future? Is it currently
safe?

Thanks,
HS

Re: Using java's getBytes() vs using Bytes.getBytes()

Posted by Stack <st...@duboce.net>.
Bytes.toBytes does explicit UTF8.  Java's toBytes will use the
machine's locale which could vary by client.
St.Ack

On Thu, May 26, 2011 at 8:03 AM, Hari Sreekumar
<hs...@clickable.com> wrote:
> Hi,
>
> I have seen people using java's native .toBytes() function without any
> problems which converting tablenames etc. to bytes. I would just like to
> confirm if using java's native toBytes() is fine. Is there a possibility
> that the HBase byte conversion codec might change in future? Is it currently
> safe?
>
> Thanks,
> HS
>