code: function (tnf, type, id, payload) {
  
          // handle null values
          if (!tnf) { tnf = ndef.TNF_EMPTY; }
          if (!type) { type = []; }
          if (!id) { id = []; }
          if (!payload) { payload = []; }
  
          // store type as String so it's easier to compare
          if(type instanceof Array) {
              type = util.bytesToString(type);
          }
  
          // in the future, id could be a String
          if (!(id instanceof Array)) {
             id = util.stringToBytes(id);
          }
  
          // Payload must be binary
          if (!(payload instanceof Array)) {
             payload = util.stringToBytes(payload);
          }
  
          var record = {
              tnf: tnf,
              type: type,
              id: id,
              payload: payload
          };
  
          // Experimental feature
          // Convert payload to text for Text and URI records
          if (tnf === ndef.TNF_WELL_KNOWN) {
              switch(record.type) {
                  case ndef.RTD_TEXT:
                      record.value = ndef.text.decodePayload(record.payload);
                      break;
                  case ndef.RTD_URI:
                      record.value = ndef.uri.decodePayload(record.payload);
                      break;
              }
          }
  
          return record;
      }
docs: [0x48, 0x73] 
  Creates a JSON representation of a NDEF Record.
  
  @tnf 3-bit TNF (Type Name Format) - use one of the TNF_* constants
  @type byte array, containing zero to 255 bytes, must not be null
  @id byte array, containing zero to 255 bytes, must not be null
  @payload byte array, containing zero to (2 ** 32 - 1) bytes, must not be null
  
  @returns JSON representation of a NDEF record
  
  @see Ndef.textRecord, Ndef.uriRecord and Ndef.mimeMediaRecord for examples