I noticed that FilterOutputStream is really not implemented for a simple delegation. Look at how its write method is implemented:

public void write(byte b[], int off, int len) throws IOException {
        if ((off | len | (b.length - (len + off)) | (off + len)) < 0)
            throw new IndexOutOfBoundsException();
        for (int i = 0 ; i < len ; i++) {
            write(b[off + i]);
        }
    }


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2793 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-03-30 05:41:32 +00:00
1 parent 43d1a34f07
commit 9b1cd8628d
4 files changed
+47 -7

No files matched your search

@@ -1,12 +1,14 @@
package hudson;
import java.io.FilterOutputStream;
import hudson.util.DelegatingOutputStream;
import java.io.OutputStream;
/**
* {@link OutputStream} that blocks {@link #close()} method.
* @author Kohsuke Kawaguchi
*/
public class CloseProofOutputStream extends FilterOutputStream {
public class CloseProofOutputStream extends DelegatingOutputStream {
public CloseProofOutputStream(OutputStream out) {
super(out);
}