Java Byte Array Convert To bytes_to_short(byte[] buf, int offset)

Here you can find the source of bytes_to_short(byte[] buf, int offset)

Description

bytetshort

License

Open Source License

Declaration

public static long bytes_to_short(byte[] buf, int offset) 

Method Source Code

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

public class Main {
    public static long bytes_to_short(byte[] buf, int offset) {
        return bytes_to_long(buf, offset);
    }//from w  ww .  j  a va 2s.co m

    public static long bytes_to_long(byte[] buf, int offset) {
        return ((buf[offset] & 0xffL) << 24)
                + ((buf[offset + 1] & 0xffL) << 16)
                + ((buf[offset + 2] & 0xffL) << 8)
                + ((buf[offset + 3] & 0xffL));
    }
}

Related

  1. bytes2nibbles(byte[] bytes)
  2. bytes2unique(byte[] daten, int offset)
  3. Bytes4ToInt(byte abyte0[], int offset)
  4. Bytes8ToLong(byte abyte0[], int offset)
  5. bytes_to_sbuf(byte[] data, int offset, int length, StringBuffer buf)
  6. bytes_to_str(byte[] data)
  7. bytesToAlphaNumeric(byte[] number)
  8. bytesToAsciiMaybe(byte[] data)
  9. bytesToBlocks(final long bytes, final int blockSize)