Java Byte Array Convert To BytesToInt(byte abyte0[], int offset)

Here you can find the source of BytesToInt(byte abyte0[], int offset)

Description

Bytes To Int

License

Apache License

Declaration

public static int BytesToInt(byte abyte0[], int offset) 

Method Source Code

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

public class Main {
    public static int BytesToInt(byte abyte0[], int offset) {
        return (int) to_number(abyte0, offset, 2);
    }//w ww.j a v a2  s .  c  o m

    static public final long to_number(byte[] p, int off, int len) {
        long ret = 0;
        int done = off + len;
        for (int i = off; i < done; i++)
            ret = ((ret << 8) & 0xffffffff) + (p[i] & 0xff);

        return ret;
    }
}

Related

  1. bytesToCompressedBases(final byte[] readBases)
  2. bytesToCompressedBases(final byte[] readBases)
  3. bytesToData(byte[][] fileData)
  4. bytesToDec(byte[] bytes)
  5. bytesToEntryCreditAddress(byte[] key)
  6. bytesToIpString(byte[] bytes)
  7. bytesToLength(final byte bytes[])
  8. bytesToMac(byte[] bytes)
  9. bytesToMac(final byte[] bytes)