Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

java.nio?

Thread view: 
Stefan Ram - 30 Aug 2007 23:47 GMT
I am holding byte blocks (of, e.g., 16 bytes) in a large byte
 array (of n·16 bytes) sorted with respect to those blocks.
 I also have another unsorted byte array of »recent additions«.
 It is anticipated that often it has to be determined whether a
 certain block is contained in any of those two arrays.
 I.e., both blocks together implement a »set of byte blocks«.

 Eventually, the recent additions will be sorted and then both
 arrays will be written out to a file. The file is to contain
 the byte blocks of both arrays in a sorted order, so the next
 byte block written is chosen from both arrays to be the
 smallest left.

 I assume that I could implement the file access via either
 java.io or java.nio. So, what should I choose?

 In the web I read, that »NIO will be particularly relevant for
 developers of high-performance applications such as database
 engines«. My pair of arrays might be considered to be a kind
 of »database engine«. But still I do not know whether
 java.nio will have any benefits in my case.
Roedy Green - 01 Sep 2007 13:29 GMT
>But still I do not know whether
>  java.nio will have any benefits in my case.

With NIO you plop your data directly in to the buffer.  From there it
goes straight to disk, (or at least your can arrange that).  With
ordinary i/o, data gets passed from level to level, usually in tiny
chunks.  You can't very well help but come out faster with NIO.

However NIO is not as intuitive as ordinary i/o and is even uglier, so
you likely would not want to bother unless there were a pressing need
for the speed.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.