Package org.apache.tapestry5

## Interface StreamResponse

- All Known Implementing Classes:
    `TextStreamResponse`

      public interface StreamResponse

  An alternate response from a component event handler method used to directly provide a stream of data to be sent to the client, rather than indicating what page to send a render redirect request to.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getContentType()` | Returns the content type to be reported to the client.
    `java.io.InputStream` | `getStream()` | Returns the stream of bytes to be sent to the client.
    `void` | `prepareResponse​(Response response)` | Prepares the response before it is sent to the client.

- - ### Method Detail

    - #### getContentType

          java.lang.String getContentType()

      Returns the content type to be reported to the client.

    - #### getStream

          java.io.InputStream getStream()
                                 throws java.io.IOException

      Returns the stream of bytes to be sent to the client. The stream will be closed when the end of the stream is reached. The provided stream will be wrapped in a `BufferedInputStream` for efficiency.
      Throws:
        `java.io.IOException`

    - #### prepareResponse

          void prepareResponse​(Response response)

      Prepares the response before it is sent to the client. This is the place to set any response headers (e.g. content-disposition).
      Parameters:
        `response` - Response that will be sent.