From this example (Get the organizer's calendar appointment using EWS for Exchange 2010) I can get the ID string from UID. But the problem is I wrote in Android, not C#. So I need the same method to convert string to hex array and to base 64 string in Java. How can I get it?
private static string GetObjectIdStringFromUid( string id )
{
var buffer = new byte[ id.Length / 2 ];
for ( int i = 0; i < id.Length / 2; i++ )
{
var hexValue = byte.Parse( id.Substring( i * 2, 2 ), System.Globalization.NumberStyles.AllowHexSpecifier );
buffer[ i ] = hexValue;
}
return Convert.ToBase64String( buffer );
}
Example Input:
00000000F1985146856BD941BA2343776A64673F0700855A223A9715B6468B4D00795E77CAAB00000033E03A0000855A223A9715B6468B4D00795E77CAAB00000034860B0000
Output:
AAAAAPGYUUaFa9lBuiNDd2pkZz8HAIVaIjqXFbZGi00AeV53yqsAAAAz4DoAAIVaIjqXFbZGi00AeV53yqsAAAA0hgsAAA==