KickJava   Java API By Example, From Geeks To Geeks.

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


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.ByteArrayInputStream JavaDoc;
19 import java.io.IOException JavaDoc;
20 import java.io.InputStream JavaDoc;
21
22 import javax.servlet.ServletInputStream JavaDoc;
23
24 /**
25  *
26  * @author Jacob Hookom
27  * @version $Id: MockServletInputStream.java,v 1.1 2005/07/18 08:25:42 jhook Exp $
28  */

29 public class MockServletInputStream extends ServletInputStream JavaDoc {
30
31     private final InputStream JavaDoc source;
32     
33     public MockServletInputStream() {
34         this.source = new ByteArrayInputStream JavaDoc(new byte[0]);
35     }
36     
37     public MockServletInputStream(InputStream JavaDoc source) {
38         this.source = source;
39     }
40
41     public int read() throws IOException JavaDoc {
42         return this.source.read();
43     }
44
45 }
46
Popular Tags