Here you can find the source of bytes2intLE(byte[] bytes, int offset, int len)
Parameter | Description |
---|---|
bytes | a parameter |
offset | a parameter |
len | a parameter |
public static int bytes2intLE(byte[] bytes, int offset, int len)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013, 2015 Orange.//from w ww . j a v a2 s. co m * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Victor PERRON, Antonin CHAZALET, Andre BOTTARO. *******************************************************************************/ public class Main { /** * @param bytes * @param offset * @param len * @return bytes2intLE */ public static int bytes2intLE(byte[] bytes, int offset, int len) { int sum = 0; for (int i = 0; i < len; i++) { byte b = bytes[offset + len - i - 1]; sum = sum + ((b & 0xff) << (i * 8)); } return sum; } }