All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.mule.module.cxf.support.DelegatingOutputStream Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 * The software in this package is published under the terms of the CPAL v1.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE.txt file.
 */
package org.mule.module.cxf.support;

import java.io.IOException;
import java.io.OutputStream;

public class DelegatingOutputStream extends OutputStream
{
    private OutputStream outputStream;


    public DelegatingOutputStream(OutputStream outputStream)
    {
        super();
        this.outputStream = outputStream;
    }
    
    public OutputStream getOutputStream()
    {
        return outputStream;
    }

    public void setOutputStream(OutputStream outputStream)
    {
        this.outputStream = outputStream;
    }

    public void close() throws IOException
    {
        outputStream.close();
    }

    public boolean equals(Object obj)
    {
        return outputStream.equals(obj);
    }

    public void flush() throws IOException
    {
        outputStream.flush();
    }

    public int hashCode()
    {
        return outputStream.hashCode();
    }

    public String toString()
    {
        return outputStream.toString();
    }

    public void write(byte[] b, int off, int len) throws IOException
    {
        synchronized (outputStream)
        {
            outputStream.write(b, off, len);
        }

    }

    public void write(byte[] b) throws IOException
    {
        synchronized (outputStream)
        {
            outputStream.write(b);
        }
    }

    public void write(int b) throws IOException
    {
        synchronized (outputStream)
        {
            outputStream.write(b);
        }
    }
    
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy