Clover coverage report - Code Coverage for tapestry release 4.0-rc-2
Coverage timestamp: Sat Dec 17 2005 09:39:46 PST
file stats: LOC: 72   Methods: 6
NCLOC: 40   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TeeOutputStream.java - 71.4% 66.7% 70%
coverage coverage
 1    // Copyright 2005 The Apache Software Foundation
 2    //
 3    // Licensed under the Apache License, Version 2.0 (the "License");
 4    // you may not use this file except in compliance with the License.
 5    // You may obtain a copy of the License at
 6    //
 7    // http://www.apache.org/licenses/LICENSE-2.0
 8    //
 9    // Unless required by applicable law or agreed to in writing, software
 10    // distributed under the License is distributed on an "AS IS" BASIS,
 11    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12    // See the License for the specific language governing permissions and
 13    // limitations under the License.
 14   
 15    package org.apache.tapestry.util.io;
 16   
 17    import java.io.IOException;
 18    import java.io.OutputStream;
 19   
 20    import org.apache.hivemind.util.Defense;
 21   
 22    /**
 23    * An output stream that copies bytes pushed through it to two other output streams.
 24    *
 25    * @author Howard M. Lewis Ship
 26    * @since 4.0
 27    */
 28    public class TeeOutputStream extends OutputStream
 29    {
 30    private final OutputStream _os1;
 31   
 32    private final OutputStream _os2;
 33   
 34  22 public TeeOutputStream(OutputStream os1, OutputStream os2)
 35    {
 36  22 Defense.notNull(os1, "os1");
 37  22 Defense.notNull(os2, "os2");
 38   
 39  22 _os1 = os1;
 40  22 _os2 = os2;
 41    }
 42   
 43  21 public void close() throws IOException
 44    {
 45  21 _os1.close();
 46  21 _os2.close();
 47    }
 48   
 49  63 public void flush() throws IOException
 50    {
 51  63 _os1.flush();
 52  63 _os2.flush();
 53    }
 54   
 55  21 public void write(byte[] b, int off, int len) throws IOException
 56    {
 57  21 _os1.write(b, off, len);
 58  21 _os2.write(b, off, len);
 59    }
 60   
 61  0 public void write(byte[] b) throws IOException
 62    {
 63  0 _os1.write(b);
 64  0 _os1.write(b);
 65    }
 66   
 67  0 public void write(int b) throws IOException
 68    {
 69  0 _os1.write(b);
 70  0 _os2.write(b);
 71    }
 72    }