/** * Converts an {@code InputStream} to a {@code Reader}. * <p> * This ensures that any Unicode byte order marker is used correctly. * The default encoding is UTF-8 if no BOM is found. * * @param inputStream the input stream to wrap * @return the reader, that uses the BOM to determine the encoding * @throws IOException if an IO error occurs */ public static Reader toReader(InputStream inputStream) throws IOException { return new BomReader(inputStream); }