All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.asciidoctor.converter.StringConverter Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.asciidoctor.converter;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Map;

/**
 * The base class for simple converters that convert to strings.
 * If the result should be written to a stream or file it is encoded with the {@code UTF-8} encoding.
 */
public abstract class StringConverter extends AbstractConverter {

    public StringConverter(String backend, Map opts) {
        super(backend, opts);
    }

    @Override
    public void write(String output, OutputStream out) throws IOException {
        if (output != null) {
            out.write(output.getBytes(Charset.forName("UTF-8")));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy