The both lines above are wrong:
z1 = (float) buffer.get(offset) / 0x7fffffff; offset++;
z2 = (float) buffer.get(offset) / 0x7fffffff; offset++;
Actually, the select buffer contains 32-bits unsigned integers stored into 32-bits signed integers. Then, the last digit is wrongly used as a sign bit. As Java has no unsigned type, at least 33 bits are required to store these positive values with their sign. Therefore, the long type (64 bits) should be used. The both lines above often work correctly except when the depth values are bigger than 2^31. I assume that they have been copied from an example written in C++. We should rather do this:
z1 = (float) (buffer.get(offset)& 0xffffffffL) / 0x7fffffff; offset++;
z2 = (float) (buffer.get(offset)& 0xffffffffL) / 0x7fffffff; offset++;
EGit is quite beta. I wouldnt use it if you are not forced to. I recommend using the gitbash/git cmdline interface as long as EGit is that bugged. It's quite easy to use and gives u far more control over things if stg went wrong with ur commit.