Help reading large files
I hope you can help me puzzle this newbie conundrum out !
My eventual goal is to create an RSAPSS digital signature of a file.
This question specifically relates to the update method prior to calling the sign method.
As you probably know, update() accepts input of ByteBuffer, byte and byte.
I know for a fact that many files I will be dealing with will be quite big (low single digit GB in size). And therefore its a fact I will need to write appropriate code to read the files, otherwise my app will be very slow.
Looking around the internet, I have found this blog post which suggests either a "FileChannel with a direct ByteBuffer and array reads" or "FileChannel with a wrapped array ByteBuffer and direct array access" are the way to go.
The blog article gives examples, which I sort of understand, but as a newbie to Java I'm not quite clear how I can integrate the update() method.
Probably a very simple answer, but I'm suffering a bit of code-writer's block, so perhaps someone would be kind enough to help me understand what I need to do ?
Thank you in advance !
P.S. If it is of any significance, I will likely be using the IAIK crypto toolkit. RSAPss javadoc can be found here.