dev@jsr311.java.net

Re: JSR311: Response isn't adequate

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 10 Mar 2008 12:01:06 -0400

Stephan Koops wrote:
> Hi all,
>>> [ ... discussion about the OutputStream ... ]
>> The major use case is usability. People will want to use simple
>> output streams.
> what about the following:
>
> @GET
> public Object get()
> {
> // ...
> return new javax.ws.rs.StreamingOutput() // interface with one method
> {
> public void print(java.io.OutputStream out) // perhaps more
> parameters
> {
> out.write(...)
> out.write(...)
> out.write(...)
> out.write(...)
> out.write(...)
> }
> }
> }
>
> This allows using the OutputStream and follow the design arguments of
> Jerome.
>

Please no. All that silly syntax sugar just to stream? We're supposed
to be making it easier for people to develop. The container can
*easily* proxy OutputStream to bridge any funky internal I/O that is
going on. I really don't care if vendor implementations are more
difficult to write because we want to expose an OutputStream for easy
streaming.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com