>> preserves sign, and we don't necessarily want that. Instead, try using >>>. This performs a logical shift, so the sign isn't preserved. Also, when you perform this shift, there will be no need to perform the and operation because we'll only have the most significant byte. So, this can be reduced to:
buf[I+1] = (byte)( invert >>> 8 )