Package org.jboss.resteasy.specimpl

## Class BuiltResponse

- java.lang.Object
- - javax.ws.rs.core.Response
  - - org.jboss.resteasy.specimpl.AbstractBuiltResponse
    - - org.jboss.resteasy.specimpl.BuiltResponse

- All Implemented Interfaces:
    `AutoCloseable`
  Direct Known Subclasses:
    `BuiltResponseEntityNotBacked`, `ClientResponse`, `ServerResponse`

      public class BuiltResponse
      extends AbstractBuiltResponse

  A response object not attached to a client or server invocation.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse

      `AbstractBuiltResponse.InputStreamWrapper<T extends BuiltResponse>`

    - ### Nested classes/interfaces inherited from class javax.ws.rs.core.Response

      `javax.ws.rs.core.Response.ResponseBuilder, javax.ws.rs.core.Response.Status, javax.ws.rs.core.Response.StatusType`

  - ### Field Summary

    - ### Fields inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse

      `annotations, bufferedEntity, entity, entityClass, genericType, is, isClosed, metadata, processor, reason, status, streamFullyRead, streamRead`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BuiltResponse()` |
    `BuiltResponse​(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)` |
    `BuiltResponse​(int status, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `bufferEntity()` |
    `protected InputStream` | `getEntityStream()` |
    `protected InputStream` | `getInputStream()` |
    `<T> T` | `readEntity​(Class<T> type, Type genericType, Annotation[] anns)` |
    `protected <T> Object` | `readFrom​(Class<T> type, Type genericType, javax.ws.rs.core.MediaType media, Annotation[] annotations)` |
    `void` | `releaseConnection()` | Release underlying connection but do not close.
    `void` | `releaseConnection​(boolean consumeInputStream)` | Release underlying connection but do not close.
    `protected void` | `setInputStream​(InputStream is)` |

    - ### Methods inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse

      `abortIfClosed, addMethodAnnotations, close, getAllowedMethods, getAnnotations, getCookies, getDate, getEntity, getEntityClass, getEntityTag, getGenericType, getHeaderString, getHeaderValueProcessor, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getMetadata, getReasonPhrase, getStatus, getStatusInfo, getStringHeaders, hasEntity, hasLink, isClosed, readEntity, readEntity, readEntity, readEntity, resetEntity, setAnnotations, setEntity, setEntityClass, setGenericType, setMetadata, setReasonPhrase, setStatus, setStreamFullyRead, setStreamRead, toHeaderString`

    - ### Methods inherited from class javax.ws.rs.core.Response

      `accepted, accepted, created, fromResponse, getHeaders, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, status, temporaryRedirect`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BuiltResponse

          public BuiltResponse()

    - #### BuiltResponse

          public BuiltResponse​(int status,
                               Headers<Object> metadata,
                               Object entity,
                               Annotation[] entityAnnotations)

    - #### BuiltResponse

          public BuiltResponse​(int status,
                               String reason,
                               Headers<Object> metadata,
                               Object entity,
                               Annotation[] entityAnnotations)

  - ### Method Detail

    - #### readEntity

          public <T> T readEntity​(Class<T> type,
                                  Type genericType,
                                  Annotation[] anns)

      Specified by:
        `readEntity` in class `AbstractBuiltResponse`

    - #### readFrom

          protected <T> Object readFrom​(Class<T> type,
                                        Type genericType,
                                        javax.ws.rs.core.MediaType media,
                                        Annotation[] annotations)

    - #### getEntityStream

          protected InputStream getEntityStream()

      Specified by:
        `getEntityStream` in class `AbstractBuiltResponse`

    - #### setInputStream

          protected void setInputStream​(InputStream is)

      Specified by:
        `setInputStream` in class `AbstractBuiltResponse`

    - #### getInputStream

          protected InputStream getInputStream()

      Specified by:
        `getInputStream` in class `AbstractBuiltResponse`

    - #### releaseConnection

          public void releaseConnection()
                                 throws IOException

      Description copied from class: `AbstractBuiltResponse`
      Release underlying connection but do not close.
      Specified by:
        `releaseConnection` in class `AbstractBuiltResponse`
      Throws:
        `IOException` - if I/O error occurred

    - #### releaseConnection

          public void releaseConnection​(boolean consumeInputStream)
                                 throws IOException

      Description copied from class: `AbstractBuiltResponse`
      Release underlying connection but do not close.
      Specified by:
        `releaseConnection` in class `AbstractBuiltResponse`
      Parameters:
        `consumeInputStream` - boolean to indicate either the underlying input stream must be fully read before releasing the connection or not.

        For most HTTP connection implementations, consuming the underlying input stream before releasing the connection will help to ensure connection reusability with respect of Keep-Alive policy.

      Throws:
        `IOException` - if I/O error occured

    - #### bufferEntity

          public boolean bufferEntity()

      Specified by:
        `bufferEntity` in class `javax.ws.rs.core.Response`