import org.apache.camel.StreamCache;
<BUG>import org.apache.camel.converter.IOConverter;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.IOHelper;
public class CachedOutputStream extends OutputStream {
public static final String THRESHOLD = "CamelCachedOutputStreamThreshold";</BUG>
public static final String TEMP_DIR = "CamelCachedOutputStreamOutputDirectory";
<BUG>protected boolean outputLocked;
protected OutputStream currentStream;
private final List<Object> streamList = new ArrayList<Object>();
private long threshold = 64 * 1024;
private int totalLength;
private boolean inMemory;
private File tempFile;</BUG>
private File outputDir;

import org.apache.camel.StreamCache;
import org.apache.camel.impl.SynchronizationAdapter;
import org.apache.camel.util.FileUtil;
import org.apache.camel.util.IOHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class CachedOutputStream extends OutputStream {
private static final transient Log LOG = LogFactory.getLog(CachedOutputStream.class);
public static final String THRESHOLD = "CamelCachedOutputStreamThreshold";
public static final String TEMP_DIR = "CamelCachedOutputStreamOutputDirectory";
private OutputStream currentStream = new ByteArrayOutputStream(2048);
private boolean inMemory = true;
private int totalLength;
private File tempFile;
