Best way to get a few bytes from a java.nio.FileChannel'ed file...
What do you think is the best way to read a few bytes
from a file that's been loaded up a FileChannel ? Should
I necessarily map it (I only need a few tens of bytes, even
when my file is several hundreds of megs big !) ? Or should
I use one of the 4 'read()' methods the FileChannel class
provides ? If so, how should instantiate the ByteBuffer
required to work with these 'read()' methods ? And what's
its use actually ?
(in fact I don't want to map my files, because they may
happen to be pretty large -several hundreds of megs-, and
mapping them would force me to lay down some algorithm to
deal with the files size in order to map them by chunks...)
Thanks in advance !
|All times are GMT. The time now is 12:38 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.