tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Caron <>
Subject Obtain a SocketChannel instead of OutputStream ?
Date Tue, 05 Feb 2008 15:22:21 GMT
My application is a scientific data server that transfers large amounts of binary data. I am
looking to make it as fast as possible and have been experimenting with the NIO FileChannel.transferTo()
method. This appears to be much faster (3-10X) than using an OutputStream, under some circumstances.
So I am trying to see if I can use this from within Tomcat.

So the question is whether there is a way to obtain a SocketChannel for the connection? The
standard interface only allows to get an OutputStream. While Channels.newChannel(OutputStream
out) gives a WriteableByteChannel, the transferTo() method does not work on it, apparently
one needs to get the SocketChannel at a deeper level.

Has anyone else tried this? Any ideas would be much appreciated.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message