1 16 17 package org.springframework.mock.web; 18 19 import java.io.IOException ; 20 import java.io.OutputStream ; 21 22 import javax.servlet.ServletOutputStream ; 23 24 34 public class DelegatingServletOutputStream extends ServletOutputStream { 35 36 private final OutputStream targetStream; 37 38 39 43 public DelegatingServletOutputStream(OutputStream targetStream) { 44 this.targetStream = targetStream; 45 } 46 47 public OutputStream getTargetStream() { 48 return targetStream; 49 } 50 51 52 public void write(int b) throws IOException { 53 this.targetStream.write(b); 54 } 55 56 public void flush() throws IOException { 57 super.flush(); 58 this.targetStream.flush(); 59 } 60 61 public void close() throws IOException { 62 super.close(); 63 this.targetStream.close(); 64 } 65 66 } 67 | Popular Tags |