|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.util.EntityUtils
public final class EntityUtils
Static helpers for dealing with HttpEntitys.
| Method Summary | |
|---|---|
static String |
getContentCharSet(HttpEntity entity)
Obtains character set of the entity, if known. |
static byte[] |
toByteArray(HttpEntity entity)
Read the contents of an entity and return it as a byte array. |
static String |
toString(HttpEntity entity)
Read the contents of an entity and return it as a String. |
static String |
toString(HttpEntity entity,
String defaultCharset)
Get the entity content as a String, using the provided default character set if none is found in the entity. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] toByteArray(HttpEntity entity)
throws IOException
entity -
IOException - if an error occurs reading the input stream
IllegalArgumentException - if entity is null or if content length > Integer.MAX_VALUE
public static String getContentCharSet(HttpEntity entity)
throws ParseException
entity - must not be null
ParseException - if header elements cannot be parsed
IllegalArgumentException - if entity is null
public static String toString(HttpEntity entity,
String defaultCharset)
throws IOException,
ParseException
entity - must not be nulldefaultCharset - character set to be applied if none found in the entity
ParseException - if header elements cannot be parsed
IllegalArgumentException - if entity is null or if content length > Integer.MAX_VALUE
IOException - if an error occurs reading the input stream
public static String toString(HttpEntity entity)
throws IOException,
ParseException
entity -
ParseException - if header elements cannot be parsed
IllegalArgumentException - if entity is null or if content length > Integer.MAX_VALUE
IOException - if an error occurs reading the input stream
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||