Question: I need to convert 2 byte array ( byte[2] ) to integer value in java. How can I do that?

Answer: 
You can use [`ByteBuffer`](http://download.oracle.com/javase/6/docs/api/java/nio/ByteBuffer.html) for this:

```
ByteBuffer buffer = ByteBuffer.wrap(myArray);
buffer.order(ByteOrder.LITTLE_ENDIAN);  // if you want little-endian
int result = buffer.getShort();

```

See also [Convert 4 bytes to int](https://stackoverflow.com/q/2383265/139010).
Simply do this:

```
return new BigInteger(byte[] yourByteArray).intValue();

```

Works great on Bluetooth command conversions etc. No need to worry about signed vs. unsigned conversion.