Java Byte Array to Short bytes2Short(byte[] input)

Here you can find the source of bytes2Short(byte[] input)

Description

bytes Short

License

Apache License

Declaration

public static short bytes2Short(byte[] input) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static short bytes2Short(byte[] input) {
        return (short) ((input[0] & 0xFF) | ((input[1] << 8) & 0xFF00));
    }/*from   ww  w.  j a  v a  2 s  . co m*/
}

Related

  1. byte2short(byte[] value, int offset)
  2. byte2Short(int loc, byte b[])
  3. bytes2short(byte[] b)
  4. bytes2Short(byte[] bytes)
  5. bytes2short(byte[] bytes, int offset, boolean bigEndian)
  6. bytes2short(byte[] src)
  7. bytesToShort(byte A, byte B)
  8. bytesToShort(byte a, byte b, boolean swapBytes)
  9. bytesToShort(byte b1, byte b2)