View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.access.dummy;
15  
16  import javax.servlet.ServletOutputStream;
17  import javax.servlet.WriteListener;
18  
19  import java.io.IOException;
20  import java.io.OutputStream;
21  
22  public class DummyServletOutputStream extends ServletOutputStream {
23  
24      private final OutputStream targetStream;
25  
26      public DummyServletOutputStream(OutputStream targetStream) {
27          this.targetStream = targetStream;
28      }
29  
30      @Override
31      public void write(int b) throws IOException {
32          this.targetStream.write(b);
33      }
34  
35      public void flush() throws IOException {
36          super.flush();
37          this.targetStream.flush();
38      }
39  
40      public void close() throws IOException {
41          super.close();
42          this.targetStream.close();
43      }
44  
45      @Override
46      public boolean isReady() {
47          // TODO Auto-generated method stub
48          return false;
49      }
50  
51      @Override
52      public void setWriteListener(WriteListener listener) {
53          // TODO Auto-generated method stub
54          
55      }
56  }