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

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

Description

to Big Endian Short

Declaration

public static short toBigEndianShort(byte[] b, int pos) 

Method Source Code

//package com.java2s;

public class Main {

    public static short toBigEndianShort(byte[] b, int pos) {
        short ret = 0;
        ret |= (b[pos] & 0xFF) << 8;
        ret |= (b[pos + 1] & 0xFF);//from   w ww .  j  a va  2  s.com
        return ret;
    }
}

Related

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