Search code examples
javahbase

"Escaped hexadecimal" to boolean


I'm working with HBase on a project and running into a seemingly simple situation that is throwing me for a loop. Hbase can store table values as escaped hexadecimal. In my case, I have true/false being stored as \x00 and \xFF, respectively.

The problem is (besides being unfamiliar with Java) I need to find a way to convert these to bool, or at least to compare them in a like-bool situation. They will never be anything other than \x00 and \xFF.

Is there not an elegant way to do this?

Please help, I'm really stuck.

Edit: This is probably relevant Hbase shell - how to write byte value


Solution

  • Ok, apparently there is a Bytes.toBoolean() function.