Here you can find the source of arrayToInt(final byte[] array, final int start)
int
, starting at an offset of start
.
Parameter | Description |
---|---|
array | a parameter |
start | a parameter |
public static int arrayToInt(final byte[] array, final int start)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { private static final int MASK_FF = 0xff; /*********************************************************************************************** * Convert the contents of the specified array to an <code><b>int</b></code>, * starting at an offset of <code>start</code>. *//from ww w .ja v a2s .co m * @param array * @param start * * @return int */ public static int arrayToInt(final byte[] array, final int start) { final int lowbits; final int highbits; lowbits = array[start] & MASK_FF; highbits = array[start + 1] & MASK_FF; return ((highbits << 8 | lowbits)); } }