Package io.sf.carte.util.agent
Class AgentUtil
java.lang.Object
io.sf.carte.util.agent.AgentUtil
User agent utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfindCharset(String conType, int afterCommaIndex) Find the character encoding in a content-type string.static ReaderinputStreamToReader(InputStream is, String conType, String contentEncoding, Charset defaultCharset)
-
Constructor Details
-
AgentUtil
public AgentUtil()
-
-
Method Details
-
findCharset
Find the character encoding in a content-type string.- Parameters:
conType- the content-type string.afterCommaIndex- the index of the first comma inconType, plus one.- Returns:
- the character encoding, or null if could not be found.
-
inputStreamToReader
public static Reader inputStreamToReader(InputStream is, String conType, String contentEncoding, Charset defaultCharset) throws IOException - Throws:
IOException
-