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

com.gitee.qdbp.staticize.common.StringCachingWriter Maven / Gradle / Ivy

There is a newer version: 3.5.18
Show newest version
package com.gitee.qdbp.staticize.common;

/**
 * 缓存字符串的Writer
 *
 * @author zhaohuihua
 * @version 20200928
 */
public class StringCachingWriter implements IWriter {

    private final StringBuilder caching = new StringBuilder();

    @Override
    public void write(Object value) {
        if (value != null) {
            caching.append(value);
        }
    }

    public String getContent() {
        return caching.toString();
    }

    public void clear() {
        this.caching.setLength(0);
    }

    @Override
    public void flush() {
    }

    @Override
    public void close() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy