static void i2bBig(int[] in,int inOfs,byte[] out,int outOfs,int len){
  if ((inOfs < 0) || ((in.length - inOfs) < len / 4) || (outOfs < 0)|| ((out.length - outOfs) < len)) {
    throw new ArrayIndexOutOfBoundsException();
  }
  if (littleEndianUnaligned) {
    outOfs+=byteArrayOfs;
    len+=outOfs;
    while (outOfs < len) {
      unsafe.putInt(out,(long)outOfs,reverseBytes(in[inOfs++]));
      outOfs+=4;
    }
  }
 else   if (bigEndian && ((outOfs & 3) == 0)) {
    outOfs+=byteArrayOfs;
    len+=outOfs;
    while (outOfs < len) {
      unsafe.putInt(out,(long)outOfs,in[inOfs++]);
      outOfs+=4;
    }
  }
 else {
    len+=outOfs;
    while (outOfs < len) {
      int i=in[inOfs++];
      out[outOfs++]=(byte)(i >> 24);
      out[outOfs++]=(byte)(i >> 16);
      out[outOfs++]=(byte)(i >> 8);
      out[outOfs++]=(byte)(i);
    }
  }
}

static void i2bBig ( int [ ] in , int inOfs , byte [ ] out , int outOfs , int len ) { if ( ( inOfs < 0 ) || ( ( in . length - inOfs ) < len / 4 ) || ( outOfs < 0 ) || ( ( out . length - outOfs ) < len ) ) { throw new ArrayIndexOutOfBoundsException ( ) ; } if ( littleEndianUnaligned ) { outOfs += byteArrayOfs ; len += outOfs ; while ( outOfs < len ) { unsafe . putInt ( out , ( long ) outOfs , reverseBytes ( in [ inOfs ++ ] ) ) ; outOfs += 4 ; } } else if ( bigEndian && ( ( outOfs & 3 ) == 0 ) ) { outOfs += byteArrayOfs ; len += outOfs ; while ( outOfs < len ) { unsafe . putInt ( out , ( long ) outOfs , in [ inOfs ++ ] ) ; outOfs += 4 ; } } else { len += outOfs ; while ( outOfs < len ) { int i = in [ inOfs ++ ] ; out [ outOfs ++ ] = ( byte ) ( i > > 24 ) ; out [ outOfs ++ ] = ( byte ) ( i > > 16 ) ; out [ outOfs ++ ] = ( byte ) ( i > > 8 ) ; out [ outOfs ++ ] = ( byte ) ( i ) ; } } }
int [ ] to byte [ ] conversion , big endian byte order .
