Interface EncodedAppender

    • Method Detail

      • append

        void append​(Encoder encoder,
                    EncodingState encodingState,
                    java.lang.CharSequence str,
                    int off,
                    int len)
             throws java.io.IOException
        Encodes a portion of a string and appends it to the buffer.
        Parameters:
        encoder - the encoder to use
        encodingState - the current encoding state of the string
        str - A String
        off - Offset from which to start encoding characters
        len - Number of characters to encode
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • appendEncoded

        void appendEncoded​(Encoder encoder,
                           EncodingState encodingState,
                           java.lang.CharSequence str,
                           int off,
                           int len)
                    throws java.io.IOException
        Appends an encoded portion of a string to the buffer
        Parameters:
        encoder - the encoder that has been applied
        encodingState - the previous encoding state of the string
        str - A String
        off - Offset from which to start encoding characters
        len - Number of characters to encode
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • append

        void append​(Encoder encoder,
                    EncodingState encodingState,
                    char[] b,
                    int off,
                    int len)
             throws java.io.IOException
        Encodes a portion of a char array and appends it to the buffer.
        Parameters:
        encoder - the encoder to use
        encodingState - the current encoding state of the string
        b - a char array
        off - Offset from which to start encoding characters
        len - Number of characters to encode
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • appendEncoded

        void appendEncoded​(Encoder encoder,
                           EncodingState encodingState,
                           char[] b,
                           int off,
                           int len)
                    throws java.io.IOException
        Appends an encoded portion of a char array to the buffer.
        Parameters:
        encoder - the encoder that has been applied
        encodingState - the previous encoding state of the char array
        b - a char array
        off - Offset from which to start encoding characters
        len - Number of characters to encode
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • append

        void append​(Encoder encoder,
                    StreamEncodeable streamEncodeable)
             throws java.io.IOException
        Encodes a StreamEncodeable instance and appends it to the buffer.
        Parameters:
        encoder - the encoder to use
        streamEncodeable - the instance to encode
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • flush

        void flush()
            throws java.io.IOException
        Flush the internal buffer and write the buffered input to a possible destination.
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • close

        void close()
            throws java.io.IOException
        Throws:
        java.io.IOException
      • setIgnoreEncodingState

        void setIgnoreEncodingState​(boolean ignoreEncodingState)
        When enabled, will encode all input regardless of it's current state disables double-encoding prevention.
        Parameters:
        ignoreEncodingState -
      • isIgnoreEncodingState

        boolean isIgnoreEncodingState()
        Returns:
        current state of ignoreEncodingState setting
      • shouldEncode

        boolean shouldEncode​(Encoder encoderToApply,
                             EncodingState encodingState)
        Check if the encoder should be used to a input with certain encodingState
        Parameters:
        encoderToApply - the encoder to apply
        encodingState - the current encoding state
        Returns:
        true, if should encode