public void stream(InputStream inputStream, MediaType mediaType) {
        try {
            OutputStream outputStream = exchange.getOutputStream();
            setResponseMediaType(mediaType);

            byte[] buffer = new byte[10240];
            int len;
            while ((len = inputStream.read(buffer)) != -1) {
                outputStream.write(buffer, 0, len);
            }
        } catch (Exception ex) {
            throw new RuntimeException("Error transferring data", ex);
        }
    }
public void stream ( InputStream inputStream , MediaType mediaType ) { try { OutputStream outputStream = exchange . getOutputStream ( ) ; setResponseMediaType ( mediaType ) ; byte [ ] buffer = new byte [ 10240 ] ; int len ; while ( ( len = inputStream . read ( buffer ) ) != - 1 ) { outputStream . write ( buffer , 0 , len ) ; } } catch ( Exception ex ) { throw new RuntimeException ( "Error transferring data" , ex ) ; } }
Transfers blocking the bytes from a given InputStream to this response

@param inputStream The data to be sent
@param mediaType   The stream Content-Type