protected static final int networkByteOrderToInt(byte[] buf,int start,int count){
  if (count > 4) {
    throw new IllegalArgumentException("Cannot handle more than 4 bytes");
  }
  int answer=0;
  for (int i=0; i < count; i++) {
    answer<<=8;
    answer|=((int)buf[start + i] & 0xff);
  }
  return answer;
}

protected static final int networkByteOrderToInt ( byte [ ] buf , int start , int count ) { if ( count > 4 ) { throw new IllegalArgumentException ( "Cannot handle more than 4 bytes" ) ; } int answer = 0 ; for ( int i = 0 ; i < count ; i ++ ) { answer <<= 8 ; answer |= ( ( int ) buf [ start + i ] & 0xff ) ; } return answer ; }
returns the integer represented by 4 bytes in network byte order .
