private static int[] stripLeadingZeroBytes(byte a[]){
  int byteLength=a.length;
  int keep;
  for (keep=0; keep < byteLength && a[keep] == 0; keep++)   ;
  int intLength=((byteLength - keep) + 3) >>> 2;
  int[] result=new int[intLength];
  int b=byteLength - 1;
  for (int i=intLength - 1; i >= 0; i--) {
    result[i]=a[b--] & 0xff;
    int bytesRemaining=b - keep + 1;
    int bytesToTransfer=Math.min(3,bytesRemaining);
    for (int j=8; j <= (bytesToTransfer << 3); j+=8)     result[i]|=((a[b--] & 0xff) << j);
  }
  return result;
}

private static int [ ] stripLeadingZeroBytes ( byte a [ ] ) { int byteLength = a . length ; int keep ; for ( keep = 0 ; keep < byteLength && a [ keep ] == 0 ; keep ++ ) ; int intLength = ( ( byteLength - keep ) + 3 ) > > > 2 ; int [ ] result = new int [ intLength ] ; int b = byteLength - 1 ; for ( int i = intLength - 1 ; i >= 0 ; i -- ) { result [ i ] = a [ b -- ] & 0xff ; int bytesRemaining = b - keep + 1 ; int bytesToTransfer = Math . min ( 3 , bytesRemaining ) ; for ( int j = 8 ; j <= ( bytesToTransfer << 3 ) ; j += 8 ) result [ i ] |= ( ( a [ b -- ] & 0xff ) << j ) ; } return result ; }
returns a copy of the input array stripped of any leading zero bytes .
