public int encodeBCI(int bci){
  if (bci <= 0 || bci > getLength())   return bci;
  Object map0=getInsnMap();
  int i, len;
  if (shrinkMaps && map0 instanceof byte[]) {
    byte[] map=(byte[])map0;
    len=map.length;
    i=Arrays.binarySearch(map,(byte)(bci + Byte.MIN_VALUE));
  }
 else   if (shrinkMaps && map0 instanceof short[]) {
    short[] map=(short[])map0;
    len=map.length;
    i=Arrays.binarySearch(map,(short)(bci + Short.MIN_VALUE));
  }
 else {
    int[] map=(int[])map0;
    len=map.length;
    i=Arrays.binarySearch(map,bci);
  }
  assert (i != -1);
  assert (i != 0);
  assert (i != len);
  assert (i != -len - 1);
  return (i >= 0) ? i : len + bci - (-i - 1);
}

public int encodeBCI ( int bci ) { if ( bci <= 0 || bci > getLength ( ) ) return bci ; Object map0 = getInsnMap ( ) ; int i , len ; if ( shrinkMaps && map0 instanceof byte [ ] ) { byte [ ] map = ( byte [ ] ) map0 ; len = map . length ; i = Arrays . binarySearch ( map , ( byte ) ( bci + Byte . MIN_VALUE ) ) ; } else if ( shrinkMaps && map0 instanceof short [ ] ) { short [ ] map = ( short [ ] ) map0 ; len = map . length ; i = Arrays . binarySearch ( map , ( short ) ( bci + Short . MIN_VALUE ) ) ; } else { int [ ] map = ( int [ ] ) map0 ; len = map . length ; i = Arrays . binarySearch ( map , bci ) ; } assert ( i != - 1 ) ; assert ( i != 0 ) ; assert ( i != len ) ; assert ( i != - len - 1 ) ; return ( i >= 0 ) ? i : len + bci - ( - i - 1 ) ; }
encode the given bci as an instruction boundary number . for completeness , irregular ( non - boundary ) bcis are encoded compactly immediately after the boundary numbers . this encoding is the identity mapping outside 0 . . length , and it is 1 - 1 everywhere . all by itself this technique improved zipped rt . jar compression by 2 . 6 % .
