public static ZrtpCacheEntry fromString ( String key , String value ) { String data = null ; String number = null ; int sep = value . indexOf ( ' ' ) ; if ( sep > 0 ) { data = value . substring ( 0 , sep ) ; number = value . substring ( sep + 1 ) ; } else { data = value ; number = "" ; } byte [ ] buffer = new byte [ data . length ( ) / 2 ] ; for ( int i = 0 ; i < buffer . length ; i ++ ) { buffer [ i ] = ( byte ) Short . parseShort ( data . substring ( i * 2 , i * 2 + 2 ) , 16 ) ; } AndroidCacheEntry entry = new AndroidCacheEntry ( key , buffer , number ) ; return entry ; }
Create a Cache Entry from the Zid string and the CSV representation of HEX RAW data and phone number