JS Bitwise Operato to Java : I'm trying to convert a js function to Java but i don't know how to work with JS Bitwise operator in java.

I need to translate this:
var r = '0x' + a.substring(j, 2) | 0     and
('0x' + a.substr(j, 2) ^ r)

Anyone has ever done this?

Thnaks!