Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bouncycastle.util.io;
 
An input stream which copies anything read through it to another stream.
 
public class TeeInputStream
    extends InputStream
    private final InputStream input;
    private final OutputStream output;

    
Base constructor.

Parameters:
input input stream to be wrapped.
output output stream to copy any input read to.
    public TeeInputStream(InputStream inputOutputStream output)
    {
        this. = input;
        this. = output;
    }
    public int read(byte[] buf)
        throws IOException
    {
        return read(buf, 0, buf.length);
    }
    public int read(byte[] bufint offint len)
        throws IOException
    {
        int i = .read(bufofflen);
        if (i > 0)
        {
            .write(bufoffi);
        }
        return i;
    }
    public int read()
        throws IOException
    {
        int i = .read();
        if (i >= 0)
        {
            .write(i);
        }
        return i;
    }
    public void close()
        throws IOException
    {
        this..close();
        this..close();
    }
    public OutputStream getOutputStream()
    {
        return ;
    }
New to GrepCode? Check out our FAQ X