Java Short Number Create toShort(byte[] key)

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

Description

to Short

License

BSD License

Declaration

public static short toShort(byte[] key) 

Method Source Code

//package com.java2s;
// BSD License (http://lemurproject.org/galago-license)

public class Main {
    public static short toShort(byte[] key) {
        assert (key.length == 2);
        int value = ((key[0] << 8) + key[1]);
        return ((short) value);
    }//from  w w w  . j a va2 s . co  m
}

Related

  1. toShort(byte[] bytes, int from)
  2. toShort(byte[] bytes, int offset)
  3. toShort(byte[] bytes, int offset)
  4. toShort(byte[] data)
  5. toShort(byte[] input)
  6. toShort(byte[] readBuffer, int o)
  7. toShort(byte[] si, boolean isReverseOrder)
  8. toShort(byte[] src)
  9. toShort(byte[] value)