Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
xmlInputFactory.createXMLEventReader(new FileInputStream(myFile));
我应该为 FIS 使用 BufferedReader-decorator 还是 XMLInputFactory 足够聪明来装饰 FileInputStream 本身?
看起来你应该能够很容易地测试这个。尝试使用和不使用 BufferedInputStream,看看哪个更快。通常,添加额外的BufferedInputStreams 通常不会增加太多开销,因为它们旨在优雅地处理这种情况。