Here you can find the source of getByteNetOrderTo_unit32(byte[] theBytes, int idx)
Parameter | Description |
---|---|
theBytes | - the array |
idx | - the starting index |
public static long getByteNetOrderTo_unit32(byte[] theBytes, int idx)
//package com.java2s; public class Main { /**/*from www . jav a2 s. c o m*/ * pull out unsigned 32 bits int out of the array. * @param theBytes - the array * @param idx - the starting index * @return the num */ public static long getByteNetOrderTo_unit32(byte[] theBytes, int idx) { long sum = 0; for (int i = 0; i < 4; i++) { sum = sum * 256 + (0xff & theBytes[i + idx]); } return sum; } }