Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jersey.spi.container
Interface ContainerResponseWriter

    public interface ContainerResponseWriter

Containers implement this interface and provide an instance to the `WebApplication` or `ContainerResponse`.

Author:
  Paul.Sandoz@Sun.Com

Method Summary
`void` | `finish()` Finish writing the response.
`java.io.OutputStream` | `writeStatusAndHeaders(long contentLength, ContainerResponse response)` Write the status and headers of the response and return an output stream for the web application to write the entity of the response.

Method Detail

### writeStatusAndHeaders

    java.io.OutputStream writeStatusAndHeaders(long contentLength,
                                               ContainerResponse response)
                                               throws java.io.IOException

  Write the status and headers of the response and return an output stream for the web application to write the entity of the response.

  Parameters:
    `contentLength` - >=0 if the content length in bytes of the entity to be written is known, otherwise -1. Containers may use this value to determine whether the "Content-Length" header can be set or utilize chunked transfer encoding.
    `response` - the container response. The status and headers are obtained from the response.
  Returns:
    the output stream to write the entity (if any).
  Throws:
    `java.io.IOException` - if an error occured when writing out the status and headers or obtaining the output stream.

### finish

    void finish()
                throws java.io.IOException

  Finish writing the response. This enables the container response writer to clean up any state or flush any streams.

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013 Oracle Corporation. All Rights Reserved.