In our application we use 3rd party checksum digest lib that requited to give source file as a byte array or as a ByteBuffer. Source files can be very to 1Mb to ~1GB . Here what is the most efficient approach to read those files in to byte array or ByteBuffer ?
Are you sure the lib requires the entire file to be passed into one single byte or ByteBuffer? Is it not something like MessageDigest that allows you to update the checksum with chunks at a time? For instance: