java.lang.Object
io.sf.carte.doc.agent.AgentUtil
User agent utility methods.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
findCharset
(String conType, int afterCommaIndex) Find the character encoding in a content-type string.static Reader
inputStreamToReader
(InputStream is, String conType, String contentEncoding, String 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, String defaultCharset) throws IOException - Throws:
IOException
-