• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anyone use the NIO package?

 
Tom Sallah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope I'm not being overly paranoid or asking a stupid question. I'm doing the URLyBird 1.1.1 assignment and wrote my Data.java class using NIO features, i.e. FileChannels and ByteBuffers. I don't see anything in my design document that says I can't use NIO, but this one comment in the document scares me: "All numeric values are stored in the header information use the formats of the DataInputStream and DataOutputStream classes." Is this telling me to use the IO package?
 
Tom Sallah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind. I did a search on bytebuffer and got an answer.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hold on there, Tom!

Take a look at the part that says what APIs you cannot use.
[ August 26, 2005: Message edited by: Barry Gaunt ]
 
Tom Sallah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my spelunking, I saw a thread pointing to those restrictions, but here's a thread from April that points to a thread that indicates the opposite:

The April thread:
http://www.coderanch.com/t/187008/java-developer-SCJD/certification/FBNS-convert-readUTF-NIO-equivalent

The link in the thread above:
http://www.coderanch.com/t/185158/java-developer-SCJD/certification/We-allowed-NIO

I'm all confused, but I think I'm going to go back and switch to IO to stay on the safe side.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if it does not prohibit NIO in your instructions then it seems to be OK to use it. Interestingly for those of us who never really got going on this thing, (I've had it 2 years and have not done any real work on it), it seems to open up some very interesting possibilities when using Java 5.0 for this thing.
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tom Sallah:
... doing the URLyBird 1.1.1 assignment and wrote my Data.java class using NIO features, i.e. FileChannels and ByteBuffers. ...


BTW. When I got my URLyBird 1.1.3, the online requirements page did state that NIO was required for the database.

The mention of DataInputStream formats stops short of saying use those methods. Such a statement would be necessay in any case to clarify the byte representation of int and long, even if you use NIO classes which don't have readInt() or the like.

Thanks for passing on the reply from SUN which states clearly how to interpret the instructions document.
 
Jeff Hinshaw
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom, I also have UB 1.1.1 and am have used nio and am planning on leaving as is. My Requirements don't seem to prohibit use of nio.
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirmed:

From: "Monica Green" <Monica.Green@Sun.COM>
To: (me)
Sent: Wednesday, September 21, 2005 9:22 PM
Subject: Re: requirement changed for SCJD assignment

> Don't worry about the current on-line requirements. What matters is
> the requirements at the time that you downloaded your assignment. At
> that time NIO was permitted, because it wasn't explicitly forbidden.
> So it's ok for you to use NIO.
 
Tom Sallah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alrighty. I gutted my NIO and replaced it with IO. I think I'm going to change back (fortunately, I have plenty of backups). It was at least a learning exercise.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic