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

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

Description

Limited to max of 8 bytes long

Parameter

Parameter Description
theBytes a parameter
idx a parameter
size a parameter

Return

signed long value.

Declaration

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

Method Source Code

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

Related

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