Java Integer Create toInt(byte[] buf)

Here you can find the source of toInt(byte[] buf)

Description

to Int

License

Apache License

Declaration

static int toInt(byte[] buf) 

Method Source Code

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

public class Main {
    static int toInt(byte[] buf) {
        int n = 0;
        for (byte b : buf) {
            n = (n << 8) + (b & 0xff);
        }//from   w ww . ja  v a 2s.  com

        return n;
    }
}

Related

  1. toInt(byte[] b)
  2. toInt(byte[] b, int begin_index, int len)
  3. toInt(byte[] block, int pos, int len)
  4. toInt(byte[] bRefArr)
  5. toInt(byte[] buf)
  6. toInt(byte[] buf, int off)
  7. toInt(byte[] buf, int pos)
  8. toInt(byte[] byteArray)
  9. toInt(byte[] bytes)