/** * 创建模板输出器 * * @param out 二进制输出流 * @param encoding 编码集 * @throws IOException 构造对象时产生IO错误 */ public TemplateWriter(OutputStream out, Charset charset) throws IOException { this.writer = SimpleOutputStreamWriter.forOutputStream(out, charset); this.out = out; }
/** * 创建模板输出器 * * @param ch nio字节流写通道 * @param encoding 编码集 * @throws IOException 构造对象时产生IO错误 */ public TemplateWriter(WritableByteChannel ch, Charset charset) throws IOException { this.writer = SimpleOutputStreamWriter.forWritableByteChannel(ch, charset); this.ch = ch; }