rest-assured/src/main/java/io/restassured/internal/http/HTTPBuilder.java
protected Object defaultSuccessHandler(HttpResponseDecorator resp, Object parsedData)
            throws ResponseParseException {
        try {
            //If response is streaming, buffer it in a byte array:
            if (parsedData instanceof InputStream) {
                ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                DefaultGroovyMethods.leftShift(buffer, (InputStream) parsedData);
                parsedData = new ByteArrayInputStream(buffer.toByteArray());
            } else if (parsedData instanceof Reader) {
                StringWriter buffer = new StringWriter();
                DefaultGroovyMethods.leftShift(buffer, (Reader) parsedData);
                parsedData = new StringReader(buffer.toString());
            } else if (parsedData instanceof Closeable)
                log.debug("Parsed data is streaming, but will be accessible after " +
                        "the network connection is closed.  Use at your own risk!");
            return parsedData;
        } catch (IOException ex) {
            throw new ResponseParseException(resp, ex);
        }
    }
protected Object defaultSuccessHandler(HttpResponseDecorator resp, Object parsedData)
            throws ResponseParseException {
        try {
            //If response is streaming, buffer it in a byte array:
            if (parsedData instanceof InputStream) {
                ByteArrayOutputStream buffer = new ByteArrayOutputStream();
                DefaultGroovyMethods.leftShift(buffer, (InputStream) parsedData);
                parsedData = new ByteArrayInputStream(buffer.toByteArray());
            } else if (parsedData instanceof Reader) {
                StringWriter buffer = new StringWriter();
                DefaultGroovyMethods.leftShift(buffer, (Reader) parsedData);
                parsedData = new StringReader(buffer.toString());
            } else if (parsedData instanceof Closeable)
                log.debug("Parsed data is streaming, but will be accessible after " +
                        "the network connection is closed.  Use at your own risk!");
            return parsedData;
        } catch (IOException ex) {
            throw new ResponseParseException(resp, ex);
        }
    }
<p>This is the default <code>response.success</code> handler.  It will be
executed if the response is not handled by a status-code-specific handler
(i.e. <code>response.'200'= {..}</code>) and no generic 'success' handler
is given (i.e. <code>response.success = {..}</code>.)  This handler simply
returns the parsed data from the response body.  In most cases you will
probably want to define a <code>response.success = {...}</code> handler
from the request closure, which will replace the response handler defined
by this method.  </p>
<p>
<p>In practice, a user-supplied response handler closure is
<i>designed</i> to handle streaming content so it can be read directly from
the response stream without buffering, which will be much more efficient.
Therefore, it is recommended that request method variants be used which
explicitly accept a response handler closure in these cases.</p>

@param resp       HTTP response
@param parsedData parsed data as resolved from this instance's {@link HttpResponseContentTypeFinder}
@return the parsed data object (whatever the parser returns).
@throws ResponseParseException if there is an error buffering a streaming
response.