Android Byte Array Bit Get getByteNetOrderTo_unit32(byte[] theBytes, int idx)

Here you can find the source of getByteNetOrderTo_unit32(byte[] theBytes, int idx)

Description

pull out unsigned 32 bits int out of the array.

Parameter

Parameter Description
theBytes - the array
idx - the starting index

Return

the num

Declaration

public static long getByteNetOrderTo_unit32(byte[] theBytes, int idx) 

Method Source Code

//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;
    }
}

Related

  1. getBitData(byte[] src, int index, boolean isLH)
  2. getBitData(byte[] src, int start, int end)
  3. getBitData(byte[] src, int start, int end, boolean isLH)
  4. getByteNetOrder(byte[] theBytes, int idx, int size)
  5. getByteNetOrderTo_unit16(byte[] theBytes, int idx)
  6. bitwiseAndByteArrays(byte[] arr0, byte[] arr1)
  7. bitwiseOrByteArrays(byte[] arr0, byte[] arr1)
  8. inverseByteArrayBits(byte[] arr0)