Flipping the high bits for compatibility with Java version.