1 15 16 package com.sun.facelets.mock; 17 18 import java.io.ByteArrayInputStream ; 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 22 import javax.servlet.ServletInputStream ; 23 24 29 public class MockServletInputStream extends ServletInputStream { 30 31 private final InputStream source; 32 33 public MockServletInputStream() { 34 this.source = new ByteArrayInputStream (new byte[0]); 35 } 36 37 public MockServletInputStream(InputStream source) { 38 this.source = source; 39 } 40 41 public int read() throws IOException { 42 return this.source.read(); 43 } 44 45 } 46 | Popular Tags |