Wednesday, February 24, 2010

Copying files in Java using NIO

Read an article on Java IO and found out that rather than using the normal stream reader classes in Java we can use the Java NIO api which does native I/O operations rather than going throught he java memory model which significatly improves I/O calls performance. Following is an example i got from that article showing how you can do a simply file copy ;

String orig ="file.xml";
String dest = "file.xml.bak";

FileChannel in = new FileInputStream(orig).getChannel();
FileChannel out = new FileOutputStream(dest).getChannel();

in.transferTo(0, in.size(), out);


Friday, February 5, 2010

Installing the Firefox JRE Plugin on Ubuntu

For sometime i have been trying to make applets work with firefix running on Ubuntu. It always failed saying cannot find plugin. Today when googling around vola i find the answer in the following post
Now applets are loading perfectly on firefox on Ubuntu.

Wednesday, February 3, 2010

Want to change your normal eclipse project to a java project?

Look no further, it is clearyly explainged here on how to change your current project type to a java project. Given to me by a collegue of mine which i thought was useful enough to blog about. Btw guys look forward to some blogs relating to stored procs with Spring as well as JBOss clustering simplified... Thats the coming attractions for now ;) ...