Replaced File class usage with BufferedInputStream