@Override protected int writeToOutputStream(DataBuffer dataBuffer) throws IOException { ByteBuffer input = dataBuffer.asByteBuffer(); int len = input.remaining(); ServletResponse response = getNativeResponse(); ((HttpOutput) response.getOutputStream()).write(input); return len; } }
@Override protected void applyHeaders() { MediaType contentType = getHeaders().getContentType(); HttpServletResponse response = getNativeResponse(); if (response.getContentType() == null && contentType != null) { response.setContentType(contentType.toString()); } Charset charset = (contentType != null ? contentType.getCharset() : null); if (response.getCharacterEncoding() == null && charset != null) { response.setCharacterEncoding(charset.name()); } long contentLength = getHeaders().getContentLength(); if (contentLength != -1) { response.setContentLengthLong(contentLength); } }
@Override protected int writeToOutputStream(DataBuffer dataBuffer) throws IOException { ByteBuffer input = dataBuffer.asByteBuffer(); int len = input.remaining(); ServletResponse response = getNativeResponse(); ((HttpOutput) response.getOutputStream()).write(input); return len; } }
@Override protected void applyHeaders() { MediaType contentType = getHeaders().getContentType(); HttpServletResponse response = getNativeResponse(); if (response.getContentType() == null && contentType != null) { response.setContentType(contentType.toString()); } Charset charset = (contentType != null ? contentType.getCharset() : null); if (response.getCharacterEncoding() == null && charset != null) { response.setCharacterEncoding(charset.name()); } long contentLength = getHeaders().getContentLength(); if (contentLength != -1) { response.setContentLengthLong(contentLength); } }
@Override protected int writeToOutputStream(DataBuffer dataBuffer) throws IOException { ByteBuffer input = dataBuffer.asByteBuffer(); int len = input.remaining(); ServletResponse response = getNativeResponse(); ((HttpOutput) response.getOutputStream()).write(input); return len; } }
@Override protected void applyHeaders() { MediaType contentType = getHeaders().getContentType(); HttpServletResponse response = getNativeResponse(); if (response.getContentType() == null && contentType != null) { response.setContentType(contentType.toString()); } Charset charset = (contentType != null ? contentType.getCharset() : null); if (response.getCharacterEncoding() == null && charset != null) { response.setCharacterEncoding(charset.name()); } long contentLength = getHeaders().getContentLength(); if (contentLength != -1) { response.setContentLengthLong(contentLength); } }