This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what's the point of java.nio?


Adam Megacz wrote:

It looks like given these two functions I could implement all of
java.nio on top of java.io. And the converse (io on nio) is certainly
true (libgcj does it).



Buffers are quite useful, especially DirectBuffers. Its nice to be able to pass around "chunks of memory that have state", rather than simply calling methods that copy into arrays. Although, in practice, since there isn't any real language support for Buffers, you end up either doing array copies anyway or making lots of inefficient get() calls. But for file I/O for example, being able to view the same buffer as (eg) ints, chars, or bytes is nice.


Regards

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]