Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.nio.ByteBuffer?

 
Elchin Asgarli
Ranch Hand
Posts: 222
Chrome Eclipse IDE Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just used a byte[] to write everything to file, using a RandomAccessFile
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well champ, I'd say that, for whatever you are using it, you are not allowed to do so.
 
Elchin Asgarli
Ranch Hand
Posts: 222
Chrome Eclipse IDE Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answers!

I used byte[], Strinng.getBytes(), System.arraycopy() and Arrays.fill()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic