I need to do some basic operations on image file in java . My requirements are like :
- opening a file.
- read bytes in some order.
- write the updated byte at the particular offset
- seeking at some offset in file.
Files can be of any size like 2 GB image files.
I want to know, which class in java can provide me the flexibility to do all these operations with ease and with performance efficiency, considering IO in java is slow.
Currently I am considering FileChannel, but I dont know about its performance with files of larger size like in GB. Also it use to read file bytes in ByteBuffer, but if file is large enough , is it appropriate to read all the bytes at same time or should read in chunks. If I read data in chunks, what is the proper size of a chunk?
Please guide me.
Thanks