001package io.jstach.jstachio.output; 002 003/** 004 * Creates output like objects with a buffer size. Some consumers of this factory may have 005 * different semantics on the buffer size parameter but in general <code>-1</code> means 006 * the buffer size is unknown. 007 * 008 * @author agent 009 * @param <T> the output type 010 * @param <E> the exception type that can be thrown on creation. 011 */ 012@FunctionalInterface 013public interface OutputFactory<T, E extends Exception> { 014 015 /** 016 * Create the output type 017 * @param bufferSize buffer size if unknown maybe <code>-1</code> 018 * @return created output 019 * @throws E if any error creating output 020 */ 021 public T create(int bufferSize) throws E; 022 023}