private static int pack8(byte[] in,int ioffset,int ilength,byte[] out,int ooffset){
  byte[] pack=pack(in,ioffset,ilength,7,8);
  int firstNonZero=pack.length - 1;
  for (int i=pack.length - 2; i >= 0; i--) {
    if (pack[i] != 0) {
      firstNonZero=i;
    }
  }
  System.arraycopy(pack,firstNonZero,out,ooffset,pack.length - firstNonZero);
  return pack.length - firstNonZero;
}

private static int pack8 ( byte [ ] in , int ioffset , int ilength , byte [ ] out , int ooffset ) { byte [ ] pack = pack ( in , ioffset , ilength , 7 , 8 ) ; int firstNonZero = pack . length - 1 ; for ( int i = pack . length - 2 ; i >= 0 ; i -- ) { if ( pack [ i ] != 0 ) { firstNonZero = i ; } } System . arraycopy ( pack , firstNonZero , out , ooffset , pack . length - firstNonZero ) ; return pack . length - firstNonZero ; }
repack from nub 7 to nub 8 , remove all unnecessary 0 headings , and paste it into an existing byte array .
