
net.dongliu.commons.request.code.BytesBodyTransformer Maven / Gradle / Ivy
package net.dongliu.commons.request.code;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;
import java.io.IOException;
/**
* @author Dong Liu
*/
public class BytesBodyTransformer implements BodyTransformer {
@Override
public byte[] fromBody(HttpEntity httpEntity) {
try {
return (EntityUtils.toByteArray(httpEntity));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy