code: public static int buff2int(byte[] bs, int offset) {
          return ((bs[offset] >= 0 ? bs[offset] : 256 + bs[offset]) << 24)
                  | ((bs[offset + 1] >= 0 ? bs[offset + 1] : 256 + bs[offset + 1]) << 16)
                  | ((bs[offset + 2] >= 0 ? bs[offset + 2] : 256 + bs[offset + 2]) << 8)
                  | (bs[offset + 3] >= 0 ? bs[offset + 3] : 256 + bs[offset + 3]);
      }
docs: buff convert to int
  
  @param bs     the buffer (big-endian)
  @param offset the start position based 0
  @return int number