Class AbstractMessageReaderWriterProvider<T>

    • Field Detail

      • UTF8

        @Deprecated
        public static final Charset UTF8
        Deprecated.
        use StandardCharsets.UTF_8 instead.
        The UTF-8 Charset.
    • Constructor Detail

      • AbstractMessageReaderWriterProvider

        public AbstractMessageReaderWriterProvider()
    • Method Detail

      • writeTo

        @Deprecated
        public static void writeTo​(InputStream in,
                                   OutputStream out)
                            throws IOException
        Deprecated.
        use ReaderWriter.writeTo(in, out) instead.
        Reader bytes from an input stream and write then to an output stream.
        Parameters:
        in - the input stream to read from.
        out - the output stream to write to.
        Throws:
        IOException - if there is an error reading or writing bytes.
      • writeTo

        @Deprecated
        public static void writeTo​(Reader in,
                                   Writer out)
                            throws IOException
        Deprecated.
        use ReaderWriter.writeTo(in, out) instead.
        Reader characters from an input stream and write then to an output stream.
        Parameters:
        in - the reader to read from.
        out - the writer to write to.
        Throws:
        IOException - if there is an error reading or writing characters.
      • getCharset

        @Deprecated
        public static Charset getCharset​(MediaType m)
        Deprecated.
        use ReaderWriter.getCharset(m) instead
        Get the character set from a media type.

        The character set is obtained from the media type parameter "charset". If the parameter is not present the StandardCharsets.UTF_8 charset is utilized.

        Parameters:
        m - the media type.
        Returns:
        the character set.
      • readFromAsString

        @Deprecated
        public static String readFromAsString​(InputStream in,
                                              MediaType type)
                                       throws IOException
        Deprecated.
        use ReaderWriter.readFromAsString(in, type) instead
        Read the bytes of an input stream and convert to a string.
        Parameters:
        in - the input stream to read from.
        type - the media type that determines the character set defining how to decode bytes to characters.
        Returns:
        the string.
        Throws:
        IOException - if there is an error reading from the input stream.
      • writeToAsString

        @Deprecated
        public static void writeToAsString​(String s,
                                           OutputStream out,
                                           MediaType type)
                                    throws IOException
        Deprecated.
        use ReaderWriter.writeToAsString(s, out, type) instead
        Convert a string to bytes and write those bytes to an output stream.
        Parameters:
        s - the string to convert to bytes.
        out - the output stream to write to.
        type - the media type that determines the character set defining how to decode bytes to characters.
        Throws:
        IOException - in case of a write failure.