Java 获取列表<;字节[]>;从输入流

Java 获取列表<;字节[]>;从输入流,java,arrays,list,inputstream,apache-httpclient-4.x,Java,Arrays,List,Inputstream,Apache Httpclient 4.x,我试图做的是从InputStream获取List。我向一个API发送HTTP请求,该API返回List,我想从内容体获取该列表 HttpPost httpPost = new HttpPost(endPoint); CloseableHttpClient httpclient = HttpClients.createDefault(); httpPost.setEntity(new ByteArrayEntity(ReqBody)); CloseableHttpResponse response

我试图做的是从
InputStream
获取
List
。我向一个API发送HTTP请求,该API返回
List
,我想从内容体获取该列表

HttpPost httpPost = new HttpPost(endPoint);
CloseableHttpClient httpclient = HttpClients.createDefault();
httpPost.setEntity(new ByteArrayEntity(ReqBody));
CloseableHttpResponse response = httpclient.execute(httpPost);
System.out.println(response.getStatusLine());
System.out.println(response.getEntity().getContentType());

return response.getEntity().getContent();

@Martin'sRun可能重复我想将其作为List而不是byte[]
List
表示列表中的每个元素都是一个字节数组。您的列表中将包含多少元素?每个元素中的字节数组将包含什么?@Abra每个元素将是您使用的协议缓冲区对象的字节[]?