wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes java.nio.ByteBuffer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
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: 5126
    
  12

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: 2258
    
    3

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()
 
jQuery in Action, 2nd edition
 
subject: java.nio.ByteBuffer?
 
Similar Threads
NIO vs IO
Writing a String to a File using FileChannel
issue with files reading and processing
NIO and performance question
End of file indication