package gnu.xml.transform;
import java.io.*;

class TeeInputStream extends FilterInputStream
{

  TeeInputStream(InputStream in)
    {
      super(in);
    }

  public int read()
    throws IOException
      {
        int c = super.read();
        System.out.write(c);
        return c;
      }
  
  public int read(byte[] b)
    throws IOException
  {
    return read(b, 0, b.length);
  }

  public int read(byte[] b, int off, int len)
    throws IOException
  {
    int l = super.read(b, off, len);
    if (l > 0)
      {
        System.out.write(b, off, l);
      }
    return l;
  }
}
