Code example for NdefRecord

Methods: getPayloadgetTnf

0
			throw new IllegalArgumentException(exception);
		} 
	} 
	 
	public static UriNdefRecord fromNdefRecord(NdefRecord ndefRecord) {
		Preconditions.checkNotNull(ndefRecord);
		 
		short tnf = ndefRecord.getTnf();
		Preconditions.checkArgument(tnf == NdefRecord.TNF_WELL_KNOWN || tnf == NdefRecord.TNF_ABSOLUTE_URI);
		 
		byte[] payload = ndefRecord.getPayload();
		 
		try { 
		    if (tnf == NdefRecord.TNF_WELL_KNOWN) {
		    	String prefix = URI_PREFIX_MAP.get(payload[0]);
		         
		        byte[] fullUri = Bytes.concat(
		                prefix.getBytes(Charset.forName("UTF-8")),
		                Arrays.copyOfRange(payload, 1, payload.length));