Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.06 KB

README.md

File metadata and controls

21 lines (14 loc) · 1.06 KB

Java File Utilities

Some useful utilities and extras not found other places.

Files.contentEquals

Uses Memory Mapped Files for fast comparison of large files. This is about 4 times faster than calling

org.apache.commons.io.FileUtils.contentEquals(file1, file2)

with identical 4 GiB files. Performance may suffer slightly for smaller files. A future version may be optimized for smaller files too.

Useful for checking if media files, such as music and video, have identical or duplicate content. Video files can easily be over 4 GiB in size. Technically this method will compare files as large as the file system supports.

Performance is about 16 seconds for two 4 GiB files with identical content on an Intel Xeon 5580 at 3.2 GHz using a file system on a LSI MegaRAID SAS 9266-8i.