Home | History | Annotate | Download | only in nfc

Lines Matching refs:mimeType

389      * The mimeType parameter will be normalized with
394 * if the mimeType parameter has serious problems,
403 * @param mimeType a valid MIME type
406 * @throws IllegalArugmentException if the mimeType is empty or invalid
409 public static NdefRecord createMime(String mimeType, byte[] mimeData) {
410 if (mimeType == null) throw new NullPointerException("mimeType is null");
415 mimeType = Intent.normalizeMimeType(mimeType);
416 if (mimeType.length() == 0) throw new IllegalArgumentException("mimeType is empty");
417 int slashIndex = mimeType.indexOf('/');
418 if (slashIndex == 0) throw new IllegalArgumentException("mimeType must have major type");
419 if (slashIndex == mimeType.length() - 1) {
420 throw new IllegalArgumentException("mimeType must have minor type");
425 byte[] typeBytes = mimeType.getBytes(StandardCharsets.US_ASCII);
646 String mimeType = new String(mType, StandardCharsets.US_ASCII);
647 return Intent.normalizeMimeType(mimeType);