Class ReusableOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.mysql.cj.protocol.x.ReusableOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

public class ReusableOutputStream
extends java.io.FilterOutputStream
An OutputStream wrapper that allows switching to different underlying OutputStreams under the same OutputStream instance.
  • Field Summary

    Fields inherited from class java.io.FilterOutputStream

    out
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ReusableOutputStream​(java.io.OutputStream out)  
  • Method Summary

    Modifier and Type Method Description
    java.io.OutputStream setOutputStream​(java.io.OutputStream newOut)
    Sets a new underlying OutputStream in this ReusableOutputStream.

    Methods inherited from class java.io.FilterOutputStream

    close, flush, write, write, write

    Methods inherited from class java.io.OutputStream

    nullOutputStream

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setOutputStream

      public java.io.OutputStream setOutputStream​(java.io.OutputStream newOut)
      Sets a new underlying OutputStream in this ReusableOutputStream.
      Parameters:
      newOut - the new OutputStream to set.
      Returns:
      the previous underlying OutputStream.