users@servlet-spec.java.net

[servlet-spec users] [jsr340-experts] Removal of ServletReader / ServletWriter and also closing down on the spec for early draft.

From: Rajiv Mordani <rajiv.mordani_at_oracle.com>
Date: Mon, 30 Apr 2012 21:11:17 -0700

We had some discusions internally and based on those discussions we feel
that the API we added ServletReader and ServletWriter should be
removed. since it is hard to get the exact amount of data to be read for
Readers via the dataAvailable method (in the case of input) and have
only the Stream based APIs for non-blocking IO. Also since we are
removing the Reader class we also don't need the dataAvailable method.
We can rely on the available() method in InputStream.

Since we have talked about the buffering I think we don't even need to
return the amount of data returned from the write operations. So I won't
be adding the write with int return values.

At this time I don't feel comfortable adding a write(ByteBuffer) to
ServletOutputStream. We need to discuss the issues raised by Remy /
Oleksiy about SSL / content encoding before adding such methods. If we
need a better mechanism for transferring of large files, I think we
should add the ServletResponse.sendFile (or something like that) like
Remy said there is in Tomcat and we can look into that. At this time
however I think we should do an early draft to get community input and
show some progress in the spec. I am fine with putting the alternate
proposal for non-blocking IO that we have discussed on the servlet-spec
project wiki and put a pointer to that in the spec for people to provide
feedback on the proposals.

I am also renaming the AsyncIOInputSource and AsyncIOOutputSink to
NonBlockingInputSource and NonBlockingOutputSink. I think that is more
appropriate for the names of the classes.

Thanks

- Rajiv