public static long parseBitrate ( String bitrate ) { if ( "N/A" . equals ( bitrate ) ) { return - 1 ; } Matcher m = BITRATE_REGEX . matcher ( bitrate ) ; if ( ! m . find ( ) ) { throw new IllegalArgumentException ( "Invalid bitrate '" + bitrate + "'" ) ; } return ( long ) ( Float . parseFloat ( m . group ( 1 ) ) * 1000 ) ; }
Converts a string representation of bitrate to a long of bits per second