01: /**
02: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03: * Licensed under the Common Development and Distribution License,
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.sun.com/cddl/
08: *
09: * 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: */package com.sun.facelets.mock;
15:
16: import java.io.ByteArrayOutputStream;
17: import java.io.IOException;
18: import java.io.OutputStream;
19:
20: import javax.servlet.ServletOutputStream;
21:
22: /**
23: *
24: * @author Jacob Hookom
25: * @version $Id: MockServletOutputStream.java,v 1.1 2005/07/18 08:25:43 jhook Exp $
26: */
27: public class MockServletOutputStream extends ServletOutputStream {
28:
29: private final OutputStream dest;
30:
31: public MockServletOutputStream() {
32: this .dest = new ByteArrayOutputStream();
33: }
34:
35: public MockServletOutputStream(OutputStream dest) {
36: this .dest = dest;
37: }
38:
39: public void write(int b) throws IOException {
40: this.dest.write(b);
41: }
42: }
|