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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to