aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes java.nio.ByteBuffer? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "java.nio.ByteBuffer?" Watch "java.nio.ByteBuffer?" New topic
Author

java.nio.ByteBuffer?

Elchin Asgarli
Ranch Hand

Joined: Mar 08, 2010
Posts: 222

Is it allowed to use java.nio.ByteBuffer? Did anyone who passed use it?

The Oracle webpage says that you have to use Standard file IO (java.io, not java.nio), and it also says NIO, the New IO facilities cannot be used.

But I am not using ByteBuffer for file I/O operations, I even wonder why is ByteBuffer in NIO package. I want to use it to buffer data before writing to database file.


Personal page, SCJP 6 with 91%, SCWCD 5 with 84%, OCMJD
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4349

I just used a byte[] to write everything to file, using a RandomAccessFile


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2212

Well champ, I'd say that, for whatever you are using it, you are not allowed to do so.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Elchin Asgarli
Ranch Hand

Joined: Mar 08, 2010
Posts: 222

Thanks for the answers!

I used byte[], Strinng.getBytes(), System.arraycopy() and Arrays.fill()
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java.nio.ByteBuffer?
 
Similar Threads
NIO and performance question
Writing a String to a File using FileChannel
NIO vs IO
End of file indication
issue with files reading and processing