} catch (UnsupportedEncodingException ex) {
Logger.getLogger(CaptionsParser.class.getName()).log(Level.SEVERE, null, ex);
}
DoubleLinkedList<Caption> subs = new DoubleLinkedList<Caption>();
Parser parser = null;
if(file.getName().toLowerCase().endsWith(".srt")) {
parser = new SrtParser();
} else if(file.getName().toLowerCase().endsWith(".sub")) {
parser = new SubParser();
}
if(parser != null) {
subs = parser.read(br);
}
return subs;
}