public class MimeTypes
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
guessImageMimeTypeString(java.lang.String uriString,
java.nio.ByteBuffer imageData)
Tries to detect the format of the given image URI and its data and
return the corresponding MIME type string.
|
static java.lang.String |
guessImageMimeTypeStringUnchecked(java.nio.ByteBuffer imageData)
Tries to detect the format of the given image data, and return the
corresponding MIME type string.
|
static java.lang.String |
imageFileNameExtensionForMimeTypeString(java.lang.String mimeTypeString)
Obtain the file name extension (without the
"." |
public static java.lang.String guessImageMimeTypeStringUnchecked(java.nio.ByteBuffer imageData)
"image/png" or
"image/gif" or "image/jpeg" (not
"image/jpg"!).imageData - The image datapublic static java.lang.String guessImageMimeTypeString(java.lang.String uriString,
java.nio.ByteBuffer imageData)
"image/png" or
"image/gif" or "image/jpeg" (not
"image/jpg"!).null will be returned.uriString - The URI stringimageData - The image datanull if it can not
be detected.public static java.lang.String imageFileNameExtensionForMimeTypeString(java.lang.String mimeTypeString)
"." dot) for
an image file with the given MIME type. Valid input and return values
are
"image/jpeg" : "jpg""image/png" : "png""image/gif" : "gif"null will
be returned.mimeTypeString - The MIME type stringCopyright © 2022. All Rights Reserved.