return super.writeWith(fluxBody.buffer().map(dataBuffers -> {
List list = Lists.newArrayList();
dataBuffers.forEach(dataBuffer -> {
try {
byte[] content = new byte[dataBuffer.readableByteCount()];
dataBuffer.read(content);
DataBufferUtils.release(dataBuffer);
list.add(new String(content, “utf-8”));
} catch (Exception e) {
log.info(“加载Response字节流异常,失败原因:{}”, Throwables.getStackTraceAsString(e));
}
});
String responseData = joiner.join(list);
System.out.println(“responseData:”+responseData);
byte[] uppedContent = new String(responseData.get Java开源项目【ali1024.coding.net/public/P7/Java/git】 Bytes(), Charset.forName(“UTF-8”)).getBytes();
originalResponse.getHeaders().setContentLength(uppedContent.length);
return bufferFactory.wrap(uppedContent);
}));
}<