Class ResponseUtils


  • public class ResponseUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ResponseUtils()  
    • Method Summary

      Modifier and Type Method Description
      static java.lang.String getCharsetFromContentType​(java.lang.String contentType)
      Parse out a charset from a content type header.
      static boolean isGzipped​(org.apache.http.Header contentEncoding)  
      static byte[] readBytes​(java.io.InputStream is)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResponseUtils

        public ResponseUtils()
    • Method Detail

      • getCharsetFromContentType

        public static java.lang.String getCharsetFromContentType​(java.lang.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.
      • readBytes

        public static byte[] readBytes​(java.io.InputStream is)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • isGzipped

        public static boolean isGzipped​(org.apache.http.Header contentEncoding)