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.ByteArrayInputStream;
17: import java.io.IOException;
18: import java.io.InputStream;
19:
20: import javax.servlet.ServletInputStream;
21:
22: /**
23: *
24: * @author Jacob Hookom
25: * @version $Id: MockServletInputStream.java,v 1.1 2005/07/18 08:25:42 jhook Exp $
26: */
27: public class MockServletInputStream extends ServletInputStream {
28:
29: private final InputStream source;
30:
31: public MockServletInputStream() {
32: this .source = new ByteArrayInputStream(new byte[0]);
33: }
34:
35: public MockServletInputStream(InputStream source) {
36: this .source = source;
37: }
38:
39: public int read() throws IOException {
40: return this.source.read();
41: }
42:
43: }
|