Java Short Number Create toShort(byte[] readBuffer, int o)

Here you can find the source of toShort(byte[] readBuffer, int o)

Description

to Short

License

Open Source License

Declaration

public static short toShort(byte[] readBuffer, int o) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static short toShort(byte[] readBuffer, int o) {
        return (short) (((readBuffer[o + 0] & 255) << 8) + ((readBuffer[o + 1] & 255) << 0));
    }//from w  ww. j ava2 s  .com

    public static short toShort(byte[] readBuffer) {
        return toShort(readBuffer, 0);
    }
}

Related

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