You can't do this easily/well with bitwise operators in java. The solution is to use a ByteBuffer.
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.put((byte)0);
byteBuffer.put((byte)0);
byteBuffer.put((byte)1);
byteBuffer.put((byte)-14);
byteBuffer.rewind();
int bodyLength = byteBuffer.getInt();
System.out.println(bodyLength);
The above code will print 498.