public static byte[] intToBytes(final int x){
  final ByteBuffer buffer=ByteBuffer.allocate(4);
  buffer.putInt(x);
  return buffer.array();
}

public static byte [ ] intToBytes ( final int x ) { final ByteBuffer buffer = ByteBuffer . allocate ( 4 ) ; buffer . putInt ( x ) ; return buffer . array ( ) ; }
converts an int value into an array of 4 bytes .
