private String write(T property, VCardVersion version) { String url = property.getUrl(); if (url != null) { return url; } byte data[] = property.getData(); if (data != null) { switch (version) { case V2_1: case V3_0: return Base64.encodeBase64String(data); case V4_0: U contentType = property.getContentType(); String mediaType = (contentType == null || contentType.getMediaType() == null) ? "application/octet-stream" : contentType.getMediaType(); return new DataUri(mediaType, data).toString(); } } return ""; }
@Override protected void _prepareParameters(T property, VCardParameters copy, VCardVersion version, VCard vcard) { MediaTypeParameter contentType = property.getContentType(); if (contentType == null) { contentType = new MediaTypeParameter(null, null, null);