dev@jsr311.java.net

Re: JSR311: Response isn't adequate

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Mon, 10 Mar 2008 16:53:26 +0100

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.

regards
    Stephan