Hi, There have been several discussions regarding java.nio, related servlet specification changes, and related tomcat implementation changes, on both the user and dev lists. I suggest you search the archives for more information if you're interested.
Having experienced the "joys" of java.nio in migrating a few of our apps, it's not worth the effort. Of course that's for our specific cases, and I make no assumptions about the general case. Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Joe Tomcat [mailto:[EMAIL PROTECTED]] >Sent: Monday, January 06, 2003 5:40 AM >To: Tomcat Users List >Subject: Tomcat and java.nio > >For those who haven't experienced the joys of java.nio yet, I highly >recomend it. Not only do you get performance advantages, but it's >easier to use, too, in my opinion. > >Speaking of which... If I have a servlet which I want to use to send a >file straight from disk to the browser, right now it seems like the best >way to do that is to get a FileChannel for the file, read it into a >buffer, and send that buffer out to the outputstream from >Request.getOutputStream(). It seems that it would be much nicer and >more efficient if there were a Request.getChannel() type of method, so I >could use the highly-efficient FileChannel.transferTo() method. Using >that method, the file could be transfered straight from the disk to the >network, possibly never leaving kernel space and possibly never being >copied (depending on OS). Perhaps Tomcat could serve static content as >quickly as its native C competitors (Apache). Is this something which >might appear in future releases of the Servlet API? I hope so. > > > >-- >To unsubscribe, e-mail: <mailto:tomcat-user- >[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:tomcat-user- >[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
