Android Big Endian Convert toBigEndianLong(byte[] b, int pos, int width)

Here you can find the source of toBigEndianLong(byte[] b, int pos, int width)

Description

to Big Endian Long

Declaration

public static long toBigEndianLong(byte[] b, int pos, int width) 

Method Source Code

//package com.java2s;

public class Main {

    public static long toBigEndianLong(byte[] b, int pos, int width) {
        long ret = 0;
        for (int i = 0; i < width; i++) {
            ret |= (b[i + pos] & 0xFFl) << (8 * (width - i - 1));
        }/*w w  w. j ava2  s .  c o m*/
        return ret;
    }
}

Related

  1. toBigEndianBytes(long x)
  2. toBigEndianBytes(short x)
  3. toBigEndianIntFromTwoBytes(byte[] b, int pos)
  4. toBigEndianInteger(byte[] b, int pos)
  5. toBigEndianInteger(byte[] b, int pos, int width)
  6. toBigEndianShort(byte[] b, int pos)
  7. toggleIntEndian(byte[] b)
  8. toggleIntEndian(byte[] b, int off, int len)
  9. toggleLongEndian(byte[] b)