Lines Matching refs:entity
65 public static byte[] toByteArray(final HttpEntity entity) throws IOException {
66 if (entity == null) {
67 throw new IllegalArgumentException("HTTP entity may not be null");
69 InputStream instream = entity.getContent();
73 if (entity.getContentLength() > Integer.MAX_VALUE) {
74 throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
76 int i = (int)entity.getContentLength();
93 public static String getContentCharSet(final HttpEntity entity)
96 if (entity == null) {
97 throw new IllegalArgumentException("HTTP entity may not be null");
100 if (entity.getContentType() != null) {
101 HeaderElement values[] = entity.getContentType().getElements();
113 final HttpEntity entity, final String defaultCharset) throws IOException, ParseException {
114 if (entity == null) {
115 throw new IllegalArgumentException("HTTP entity may not be null");
117 InputStream instream = entity.getContent();
121 if (entity.getContentLength() > Integer.MAX_VALUE) {
122 throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
124 int i = (int)entity.getContentLength();
128 String charset = getContentCharSet(entity);
149 public static String toString(final HttpEntity entity)
151 return toString(entity, null);