0

bytearray 的 readentity 没有消息正文阅读器

这发生在从 cxf 客户端读取字节响应时。

Response r = client.get();
byte[] barray = r.readEntity(byte[].class);

cxf 版本是 2.7.6

请建议我如何在其中添加消息正文阅读器。

你的建议很有价值..

4

1 回答 1

0

您可以使用传入的字节InputStream

Response r = client.get();
InputStream in = (InputStream)r.getEntity();
byte[] barray = IOUtils.readBytesFromStream(in);
于 2016-11-04T18:43:08.563 回答