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

org.jboss.resteasy.util.DelegatingOutputStream Maven / Gradle / Ivy

There is a newer version: 4.0.0.Beta5
Show newest version
package org.jboss.resteasy.util;

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

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class DelegatingOutputStream extends OutputStream
{
   protected OutputStream delegate;

   public DelegatingOutputStream()
   {
   }

   public DelegatingOutputStream(final OutputStream delegate)
   {
      this.delegate = delegate;
   }

   public OutputStream getDelegate()
   {
      return delegate;
   }

   public void setDelegate(OutputStream delegate)
   {
      this.delegate = delegate;
   }

   @Override
   public void write(int i) throws IOException
   {
      getDelegate().write(i);
   }

   @Override
   public void write(byte[] bytes) throws IOException
   {
      getDelegate().write(bytes);
   }

   @Override
   public void write(byte[] bytes, int i, int i1) throws IOException
   {
      getDelegate().write(bytes, i, i1);
   }

   @Override
   public void flush() throws IOException
   {
      getDelegate().flush();
   }

   @Override
   public void close() throws IOException
   {
      getDelegate().close();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy