1 16 17 package org.springframework.mock.web; 18 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 22 import javax.servlet.ServletInputStream ; 23 24 34 public class DelegatingServletInputStream extends ServletInputStream { 35 36 private final InputStream sourceStream; 37 38 39 43 public DelegatingServletInputStream(InputStream sourceStream) { 44 this.sourceStream = sourceStream; 45 } 46 47 public InputStream getSourceStream() { 48 return sourceStream; 49 } 50 51 52 public int read() throws IOException { 53 return this.sourceStream.read(); 54 } 55 56 public void close() throws IOException { 57 super.close(); 58 this.sourceStream.close(); 59 } 60 61 } 62 | Popular Tags |