private static UriRecord parseWellKnown(NdefRecord record){
  Preconditions.checkArgument(Arrays.equals(record.getType(),NdefRecord.RTD_URI));
  byte[] payload=record.getPayload();
  Preconditions.checkArgument(payload.length > 0);
  String prefix=URI_PREFIX_MAP.get(payload[0]);
  Preconditions.checkArgument(prefix != null);
  byte[] fullUri=Bytes.concat(prefix.getBytes(Charset.forName("UTF-8")),Arrays.copyOfRange(payload,1,payload.length));
  Uri uri=Uri.parse(new String(fullUri,Charset.forName("UTF-8")));
  return new UriRecord(uri);
}

private static UriRecord parseWellKnown ( NdefRecord record ) { Preconditions . checkArgument ( Arrays . equals ( record . getType ( ) , NdefRecord . RTD_URI ) ) ; byte [ ] payload = record . getPayload ( ) ; Preconditions . checkArgument ( payload . length > 0 ) ; String prefix = URI_PREFIX_MAP . get ( payload [ 0 ] ) ; Preconditions . checkArgument ( prefix != null ) ; byte [ ] fullUri = Bytes . concat ( prefix . getBytes ( Charset . forName ( "UTF-8" ) ) , Arrays . copyOfRange ( payload , 1 , payload . length ) ) ; Uri uri = Uri . parse ( new String ( fullUri , Charset . forName ( "UTF-8" ) ) ) ; return new UriRecord ( uri ) ; }
parse an well known uri record
