KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > facelets > mock > MockServletOutputStream


1 /**
2  * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3  * Licensed under the Common Development and Distribution 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.sun.com/cddl/
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
12  * implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */

15
16 package com.sun.facelets.mock;
17
18 import java.io.ByteArrayOutputStream JavaDoc;
19 import java.io.IOException JavaDoc;
20 import java.io.OutputStream JavaDoc;
21
22 import javax.servlet.ServletOutputStream JavaDoc;
23
24 /**
25  *
26  * @author Jacob Hookom
27  * @version $Id: MockServletOutputStream.java,v 1.1 2005/07/18 08:25:43 jhook Exp $
28  */

29 public class MockServletOutputStream extends ServletOutputStream JavaDoc {
30
31     private final OutputStream JavaDoc dest;
32     
33     public MockServletOutputStream() {
34         this.dest = new ByteArrayOutputStream JavaDoc();
35     }
36     
37     public MockServletOutputStream(OutputStream JavaDoc dest) {
38         this.dest = dest;
39     }
40
41     public void write(int b) throws IOException JavaDoc {
42         this.dest.write(b);
43     }
44 }
45
Popular Tags