Home | History | Annotate | Download | only in util

Lines Matching refs:entity

60     public static byte[] toByteArray(final HttpEntity entity) throws IOException {
61 if (entity == null) {
62 throw new IllegalArgumentException("HTTP entity may not be null");
64 InputStream instream = entity.getContent();
68 if (entity.getContentLength() > Integer.MAX_VALUE) {
69 throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
71 int i = (int)entity.getContentLength();
88 public static String getContentCharSet(final HttpEntity entity)
91 if (entity == null) {
92 throw new IllegalArgumentException("HTTP entity may not be null");
95 if (entity.getContentType() != null) {
96 HeaderElement values[] = entity.getContentType().getElements();
108 final HttpEntity entity, final String defaultCharset) throws IOException, ParseException {
109 if (entity == null) {
110 throw new IllegalArgumentException("HTTP entity may not be null");
112 InputStream instream = entity.getContent();
116 if (entity.getContentLength() > Integer.MAX_VALUE) {
117 throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
119 int i = (int)entity.getContentLength();
123 String charset = getContentCharSet(entity);
144 public static String toString(final HttpEntity entity)
146 return toString(entity, null);