* Alan Bateman: > This is a small change to add a method to sun.nio.ch.Net to get the > number of bytes in the socket input buffer. The motive for adding this > to make it possible for the socket adaptors to implement > InputStream::available and also to support an alternative SocketImpl > based on NIO.
Do you plan to read from the socket buffer in the implementation of available()? The problem is that even if there is currently data in the socket buffer, further data that arrives later can clear it. I think this can only happen as part of a connection reset. Maybe that's okay because reading will not block, but throw an exception instead? Thanks, Florian