Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Best way to get a few bytes from a java.nio.FileChannel'ed file...

Reply
Thread Tools

Best way to get a few bytes from a java.nio.FileChannel'ed file...

 
 
Spendius
Guest
Posts: n/a
 
      09-07-2003
Hi,
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 !
Regards,
Spendius
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net 2 07-29-2008 09:50 AM
When using System.IO.FileStream, I write 8 bytes, then seek to the start of the file, does the 8 bytes get flushed on seek and the buffer become a readbuffer at that point instead of being a write buffer? DR ASP .Net Building Controls 0 07-29-2008 01:37 AM
Ratio of Bytes Delayed to Bytes Sent netproj Cisco 0 12-21-2005 08:08 PM
Private Bytes vs. # Bytes in all Heaps in Perfmon Jason Collins ASP .Net 3 02-18-2004 03:59 PM
Re: receiving Bytes and sending Bytes The Old Sourdough Computer Support 0 07-23-2003 01:23 PM



Advertisments