@UnstableApi
class FileTypes


Defines common file type constants and helper methods.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation FileTypes.Type

File types.

Constants

const Int
AC3 = 0

File type for the AC-3 and E-AC-3 formats.

const Int
AC4 = 1

File type for the AC-4 format.

const Int
ADTS = 2

File type for the ADTS format.

const Int
AMR = 3

File type for the AMR format.

const Int
AVI = 16

File type for the AVI format.

const Int
AVIF = 21

File type for the AVIF format.

const Int
BMP = 19

File type for the BMP format.

const Int
FLAC = 4

File type for the FLAC format.

const Int
FLV = 5

File type for the FLV format.

const Int
HEIF = 20

File type for the HEIF format.

const Int
JPEG = 14

File type for the JPEG format.

const Int

File type for the Matroska and WebM formats.

const Int
MIDI = 15

File type for the MIDI format.

const Int
MP3 = 7

File type for the MP3 format.

const Int
MP4 = 8

File type for the MP4 format.

const Int
OGG = 9

File type for the Ogg format.

const Int
PNG = 17

File type for the PNG format.

const Int
PS = 10

File type for the MPEG-PS format.

const Int
TS = 11

File type for the MPEG-TS format.

const Int
UNKNOWN = -1

Unknown file type.

const Int
WAV = 12

File type for the WAV format.

const Int
WEBP = 18

File type for the WEBP format.

const Int
WEBVTT = 13

File type for the WebVTT format.

Public functions

java-static Int

Returns the Type corresponding to the MIME type provided.

java-static Int

Returns the Type corresponding to the response headers provided.

java-static Int

Returns the Type corresponding to the Uri provided.

Constants

AC3

const val AC3 = 0: Int

File type for the AC-3 and E-AC-3 formats.

AC4

const val AC4 = 1: Int

File type for the AC-4 format.

ADTS

const val ADTS = 2: Int

File type for the ADTS format.

AMR

const val AMR = 3: Int

File type for the AMR format.

AVI

const val AVI = 16: Int

File type for the AVI format.

AVIF

const val AVIF = 21: Int

File type for the AVIF format.

BMP

const val BMP = 19: Int

File type for the BMP format.

FLAC

const val FLAC = 4: Int

File type for the FLAC format.

FLV

const val FLV = 5: Int

File type for the FLV format.

HEIF

const val HEIF = 20: Int

File type for the HEIF format.

JPEG

const val JPEG = 14: Int

File type for the JPEG format.

MATROSKA

const val MATROSKA = 6: Int

File type for the Matroska and WebM formats.

MIDI

const val MIDI = 15: Int

File type for the MIDI format.

MP3

const val MP3 = 7: Int

File type for the MP3 format.

MP4

const val MP4 = 8: Int

File type for the MP4 format.

OGG

const val OGG = 9: Int

File type for the Ogg format.

PNG

const val PNG = 17: Int

File type for the PNG format.

PS

const val PS = 10: Int

File type for the MPEG-PS format.

TS

const val TS = 11: Int

File type for the MPEG-TS format.

UNKNOWN

const val UNKNOWN = -1: Int

Unknown file type.

WAV

const val WAV = 12: Int

File type for the WAV format.

WEBP

const val WEBP = 18: Int

File type for the WEBP format.

WEBVTT

const val WEBVTT = 13: Int

File type for the WebVTT format.

Public functions

inferFileTypeFromMimeType

@FileTypes.Type
java-static fun inferFileTypeFromMimeType(mimeType: String?): Int

Returns the Type corresponding to the MIME type provided.

Returns UNKNOWN if the MIME type is null.

inferFileTypeFromResponseHeaders

@FileTypes.Type
java-static fun inferFileTypeFromResponseHeaders(
    responseHeaders: (Mutable)Map<String!, (Mutable)List<String!>!>!
): Int

Returns the Type corresponding to the response headers provided.

inferFileTypeFromUri

@FileTypes.Type
java-static fun inferFileTypeFromUri(uri: Uri!): Int

Returns the Type corresponding to the Uri provided.