public static String toBase64(long value){
  int low=(int)(value & 0xffffffff);
  int high=(int)(value >> 32);
  StringBuilder sb=new StringBuilder();
  boolean haveNonZero=base64Append(sb,(high >> 28) & 0xf,false);
  haveNonZero=base64Append(sb,(high >> 22) & 0x3f,haveNonZero);
  haveNonZero=base64Append(sb,(high >> 16) & 0x3f,haveNonZero);
  haveNonZero=base64Append(sb,(high >> 10) & 0x3f,haveNonZero);
  haveNonZero=base64Append(sb,(high >> 4) & 0x3f,haveNonZero);
  int v=((high & 0xf) << 2) | ((low >> 30) & 0x3);
  haveNonZero=base64Append(sb,v,haveNonZero);
  haveNonZero=base64Append(sb,(low >> 24) & 0x3f,haveNonZero);
  haveNonZero=base64Append(sb,(low >> 18) & 0x3f,haveNonZero);
  haveNonZero=base64Append(sb,(low >> 12) & 0x3f,haveNonZero);
  base64Append(sb,(low >> 6) & 0x3f,haveNonZero);
  base64Append(sb,low & 0x3f,true);
  return sb.toString();
}

public static String toBase64 ( long value ) { int low = ( int ) ( value & 0xffffffff ) ; int high = ( int ) ( value > > 32 ) ; StringBuilder sb = new StringBuilder ( ) ; boolean haveNonZero = base64Append ( sb , ( high > > 28 ) & 0xf , false ) ; haveNonZero = base64Append ( sb , ( high > > 22 ) & 0x3f , haveNonZero ) ; haveNonZero = base64Append ( sb , ( high > > 16 ) & 0x3f , haveNonZero ) ; haveNonZero = base64Append ( sb , ( high > > 10 ) & 0x3f , haveNonZero ) ; haveNonZero = base64Append ( sb , ( high > > 4 ) & 0x3f , haveNonZero ) ; int v = ( ( high & 0xf ) << 2 ) | ( ( low > > 30 ) & 0x3 ) ; haveNonZero = base64Append ( sb , v , haveNonZero ) ; haveNonZero = base64Append ( sb , ( low > > 24 ) & 0x3f , haveNonZero ) ; haveNonZero = base64Append ( sb , ( low > > 18 ) & 0x3f , haveNonZero ) ; haveNonZero = base64Append ( sb , ( low > > 12 ) & 0x3f , haveNonZero ) ; base64Append ( sb , ( low > > 6 ) & 0x3f , haveNonZero ) ; base64Append ( sb , low & 0x3f , true ) ; return sb . toString ( ) ; }
return a string containing a base - 64 encoded version of the given long value . leading groups of all zero bits are omitted .
