Here you can find the source of toInt(byte mostSignificant, byte leastSignificant)
Parameter | Description |
---|---|
mostSignificant | The most significant number part |
leastSignificant | The least significant number part |
public static int toInt(byte mostSignificant, byte leastSignificant)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww.j av a2 s. co m*/ * Converts a pair of bytes to a {@code int} * @param mostSignificant The most significant number part * @param leastSignificant The least significant number part * @return A {@code int} */ public static int toInt(byte mostSignificant, byte leastSignificant) { int n = 0; n ^= mostSignificant & 0xFF; n <<= 8; n ^= leastSignificant & 0xFF; return n; } }