List of usage examples for org.apache.http.entity BufferedHttpEntity writeTo
public void writeTo(OutputStream outputStream) throws IOException
From source file:xin.nic.sdk.registrar.util.HttpUtil.java
/** * ?Entity?/*from www . ja v a2s .c o m*/ * * @param httpEntity * @return * @throws Exception */ public static byte[] getData(HttpEntity httpEntity) throws Exception { BufferedHttpEntity bufferedHttpEntity = new BufferedHttpEntity(httpEntity); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bufferedHttpEntity.writeTo(byteArrayOutputStream); byte[] responseBytes = byteArrayOutputStream.toByteArray(); return responseBytes; }