code: public static void changeWordEndianess(byte[] b, int offset,
              int length) {
          byte tmp;
  
          for (int i = offset; i < offset + length; i += 4) {
              tmp = b[i];
              b[i] = b[i + 3];
              b[i + 3] = tmp;
              tmp = b[i + 1];
              b[i + 1] = b[i + 2];
              b[i + 2] = tmp;
          }
      }
docs: Invert the endianness of words (4 bytes) in the given byte array
  starting at the given offset and repeating length/4 times.
  eg: b0b1b2b3 -> b3b2b1b0
  
  @param b the byte array
  @param offset the offset at which to change word start
  @param length the number of bytes on which to operate
  (should be a multiple of 4)