Interface CoercionOptimizer

    • Method Detail

      • optimize

        Writer optimize​(Writer out,
                        Encoder encoder)
        Unwraps a writer to expose any wrapped writer. The wrapped writer is only returned when it is write-through, meaning the wrapper doesn't modify the data written, and writes to the wrapped writer immediately (no buffering).
        Parameters:
        out - the writer to try unwrapping
        encoder - the encoder being used or null for none
        Returns:
        The functionally equivalent, but more efficient/direct, writer or out when nothing to unwrap