Package com.mashape.unirest.http.utils
Class ResponseUtils
- java.lang.Object
-
- com.mashape.unirest.http.utils.ResponseUtils
-
public class ResponseUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ResponseUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getBytes(InputStream is)static StringgetCharsetFromContentType(String contentType)Parse out a charset from a content type header.static booleanisGzipped(org.apache.http.Header contentEncoding)
-
-
-
Method Detail
-
getCharsetFromContentType
public static String getCharsetFromContentType(String contentType)
Parse out a charset from a content type header.- Parameters:
contentType- e.g. "text/html; charset=EUC-JP"- Returns:
- "EUC-JP", or null if not found. Charset is trimmed and uppercased.
-
getBytes
public static byte[] getBytes(InputStream is) throws IOException
- Throws:
IOException
-
isGzipped
public static boolean isGzipped(org.apache.http.Header contentEncoding)
-
-