Java Short Number Create toShort(byte[] b)

Here you can find the source of toShort(byte[] b)

Description

to Short

License

Apache License

Declaration

public static short toShort(byte[] b) 

Method Source Code

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

public class Main {
    public static short toShort(byte[] b) {
        return toShort(b, 0);
    }/*from   w w  w.ja v a2s.  c o m*/

    public static short toShort(byte[] b, int off) {
        return (short) (((b[off + 1] & 0xFF) << 0) + ((b[off + 0] & 0xFF) << 8));
    }
}

Related

  1. toShort(byte byte0, byte byte1)
  2. toShort(byte mostSignificant, byte leastSignificant)
  3. toShort(byte msb, byte lsb)
  4. toShort(byte... b)
  5. toShort(byte... b)
  6. toShort(byte[] b)
  7. toShort(byte[] b)
  8. toShort(byte[] b)
  9. toShort(byte[] b)