package org.bouncycastle.util.test;

import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class UncloseableOutputStream extends FilterOutputStream
{
    public UncloseableOutputStream(OutputStream s)
    {
        super(s);
    }

    public void close()
    {
        throw new RuntimeException("close() called on UncloseableOutputStream");
    }

    public void write(byte[] b, int off, int len) throws IOException
    {
        out.write(b, off, len);
    }
 }

@@ -123,16 +123,317 @@
 tream;%0A%0A
+/**%0A * This is a testing utility class to check the property that an %7B@link OutputStream%7D is never%0A * closed in some particular context - typically when wrapped by another %7B@link OutputStream%7D that%0A * should not be forwarding its %7B@link OutputStream#close()%7D calls. Not needed in production code.%0A */%0A
 public c

Add javadoc to make clear this is for testing only