public static CharSequence getMimeType ( CharSequence contentTypeValue ) { if ( contentTypeValue == null ) { throw new NullPointerException ( "contentTypeValue" ) ; } int indexOfSemicolon = AsciiString . indexOfIgnoreCaseAscii ( contentTypeValue , SEMICOLON , 0 ) ; if ( indexOfSemicolon != AsciiString . INDEX_NOT_FOUND ) { return contentTypeValue . subSequence ( 0 , indexOfSemicolon ) ; } else { return contentTypeValue . length ( ) > 0 ? contentTypeValue : null ; } }
Fetch MIME type part from Content - Type header value as a char sequence .