View Javadoc

1   /*
2    * $Id$
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.module.cxf.support;
12  
13  import java.io.IOException;
14  import java.io.OutputStream;
15  
16  public class DelegatingOutputStream extends OutputStream
17  {
18      private OutputStream outputStream;
19  
20  
21      public DelegatingOutputStream(OutputStream outputStream)
22      {
23          super();
24          this.outputStream = outputStream;
25      }
26      
27      public OutputStream getOutputStream()
28      {
29          return outputStream;
30      }
31  
32      public void setOutputStream(OutputStream outputStream)
33      {
34          this.outputStream = outputStream;
35      }
36  
37      public void close() throws IOException
38      {
39          outputStream.close();
40      }
41  
42      public boolean equals(Object obj)
43      {
44          return outputStream.equals(obj);
45      }
46  
47      public void flush() throws IOException
48      {
49          outputStream.flush();
50      }
51  
52      public int hashCode()
53      {
54          return outputStream.hashCode();
55      }
56  
57      public String toString()
58      {
59          return outputStream.toString();
60      }
61  
62      public void write(byte[] b, int off, int len) throws IOException
63      {
64          outputStream.write(b, off, len);
65      }
66  
67      public void write(byte[] b) throws IOException
68      {
69          outputStream.write(b);
70      }
71  
72      public void write(int b) throws IOException
73      {
74          outputStream.write(b);
75      }
76      
77  }
78  
79