Here you can find the source of getByteNetOrder(byte[] theBytes, int idx, int size)
Parameter | Description |
---|---|
theBytes | a parameter |
idx | a parameter |
size | a parameter |
public static long getByteNetOrder(byte[] theBytes, int idx, int size)
//package com.java2s; public class Main { /**/* w w w. j a v a 2 s . co m*/ * Limited to max of 8 bytes long * @param theBytes * @param idx * @param size * @return signed long value. */ public static long getByteNetOrder(byte[] theBytes, int idx, int size) { long sum = 0; for (int i = 0; i < size; i++) { sum = sum * 256 + (0xff & theBytes[i + idx]); } return sum; } }