Class HttpConstants


  • @Deprecated
    public class HttpConstants
    extends java.lang.Object
    Deprecated.
    use EncodingUtil class
    HTTP content conversion routines.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_CONTENT_CHARSET
      Deprecated.
      Default content encoding chatset
      static java.lang.String HTTP_ELEMENT_CHARSET
      Deprecated.
      Character set used to encode HTTP protocol elements
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpConstants()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static byte[] getAsciiBytes​(java.lang.String data)
      Deprecated.
      Converts the specified string to byte array of ASCII characters.
      static java.lang.String getAsciiString​(byte[] data)
      Deprecated.
      Converts the byte array of ASCII characters to a string.
      static java.lang.String getAsciiString​(byte[] data, int offset, int length)
      Deprecated.
      Converts the byte array of ASCII characters to a string.
      static byte[] getBytes​(java.lang.String data)
      Deprecated.
      Converts the specified string to a byte array of HTTP element characters.
      static byte[] getContentBytes​(java.lang.String data)
      Deprecated.
      Converts the specified string to a byte array of HTTP content characters using default HTTP content encoding (ISO-8859-1) This method is to be used when encoding content of HTTP request/response
      static byte[] getContentBytes​(java.lang.String data, java.lang.String charset)
      Deprecated.
      Converts the specified string to a byte array of HTTP content charachetrs This method is to be used when encoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
      static java.lang.String getContentString​(byte[] data)
      Deprecated.
      Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response
      static java.lang.String getContentString​(byte[] data, int offset, int length)
      Deprecated.
      Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response
      static java.lang.String getContentString​(byte[] data, int offset, int length, java.lang.String charset)
      Deprecated.
      Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
      static java.lang.String getContentString​(byte[] data, java.lang.String charset)
      Deprecated.
      Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
      static java.lang.String getString​(byte[] data)
      Deprecated.
      Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers)
      static java.lang.String getString​(byte[] data, int offset, int length)
      Deprecated.
      Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HTTP_ELEMENT_CHARSET

        public static final java.lang.String HTTP_ELEMENT_CHARSET
        Deprecated.
        Character set used to encode HTTP protocol elements
        See Also:
        Constant Field Values
      • DEFAULT_CONTENT_CHARSET

        public static final java.lang.String DEFAULT_CONTENT_CHARSET
        Deprecated.
        Default content encoding chatset
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpConstants

        public HttpConstants()
        Deprecated.
    • Method Detail

      • getBytes

        public static byte[] getBytes​(java.lang.String data)
        Deprecated.
        Converts the specified string to a byte array of HTTP element characters. This method is to be used when encoding content of HTTP elements (such as request headers)
        Parameters:
        data - the string to be encoded
        Returns:
        The resulting byte array.
      • getString

        public static java.lang.String getString​(byte[] data,
                                                 int offset,
                                                 int length)
        Deprecated.
        Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers)
        Parameters:
        data - the byte array to be encoded
        offset - the index of the first byte to encode
        length - the number of bytes to encode
        Returns:
        The resulting string.
      • getString

        public static java.lang.String getString​(byte[] data)
        Deprecated.
        Converts the byte array of HTTP element characters to a string This method is to be used when decoding content of HTTP elements (such as response headers)
        Parameters:
        data - the byte array to be encoded
        Returns:
        The resulting string.
      • getContentBytes

        public static byte[] getContentBytes​(java.lang.String data,
                                             java.lang.String charset)
        Deprecated.
        Converts the specified string to a byte array of HTTP content charachetrs This method is to be used when encoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
        Parameters:
        data - the string to be encoded
        charset - the desired character encoding
        Returns:
        The resulting byte array.
      • getContentString

        public static java.lang.String getContentString​(byte[] data,
                                                        int offset,
                                                        int length,
                                                        java.lang.String charset)
        Deprecated.
        Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
        Parameters:
        data - the byte array to be encoded
        offset - the index of the first byte to encode
        length - the number of bytes to encode
        charset - the desired character encoding
        Returns:
        The result of the conversion.
      • getContentString

        public static java.lang.String getContentString​(byte[] data,
                                                        java.lang.String charset)
        Deprecated.
        Converts the byte array of HTTP content characters to a string This method is to be used when decoding content of HTTP request/response If the specified charset is not supported, default HTTP content encoding (ISO-8859-1) is applied
        Parameters:
        data - the byte array to be encoded
        charset - the desired character encoding
        Returns:
        The result of the conversion.
      • getContentBytes

        public static byte[] getContentBytes​(java.lang.String data)
        Deprecated.
        Converts the specified string to a byte array of HTTP content characters using default HTTP content encoding (ISO-8859-1) This method is to be used when encoding content of HTTP request/response
        Parameters:
        data - the string to be encoded
        Returns:
        The byte array as above.
      • getContentString

        public static java.lang.String getContentString​(byte[] data,
                                                        int offset,
                                                        int length)
        Deprecated.
        Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response
        Parameters:
        data - the byte array to be encoded
        offset - the index of the first byte to encode
        length - the number of bytes to encode
        Returns:
        The string representation of the byte array.
      • getContentString

        public static java.lang.String getContentString​(byte[] data)
        Deprecated.
        Converts the byte array of HTTP content characters to a string using default HTTP content encoding (ISO-8859-1) This method is to be used when decoding content of HTTP request/response
        Parameters:
        data - the byte array to be encoded
        Returns:
        The string representation of the byte array.
      • getAsciiBytes

        public static byte[] getAsciiBytes​(java.lang.String data)
        Deprecated.
        Converts the specified string to byte array of ASCII characters.
        Parameters:
        data - the string to be encoded
        Returns:
        The string as a byte array.
      • getAsciiString

        public static java.lang.String getAsciiString​(byte[] data,
                                                      int offset,
                                                      int length)
        Deprecated.
        Converts the byte array of ASCII characters to a string. This method is to be used when decoding content of HTTP elements (such as response headers)
        Parameters:
        data - the byte array to be encoded
        offset - the index of the first byte to encode
        length - the number of bytes to encode
        Returns:
        The string representation of the byte array
      • getAsciiString

        public static java.lang.String getAsciiString​(byte[] data)
        Deprecated.
        Converts the byte array of ASCII characters to a string. This method is to be used when decoding content of HTTP elements (such as response headers)
        Parameters:
        data - the byte array to be encoded
        Returns:
        The string representation of the byte array