Class TestableByteArrayOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.google.api.client.testing.util.TestableByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

@Beta public class TestableByteArrayOutputStream extends ByteArrayOutputStream
Beta
Testable extension for a byte array output stream.
Since:
1.14
  • Field Details

    • closed

      private boolean closed
      Whether the output stream has been closed.
  • Constructor Details

    • TestableByteArrayOutputStream

      public TestableByteArrayOutputStream()
  • Method Details

    • close

      public void close() throws IOException

      Overriding is supported, but overriding method must call the super implementation.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class ByteArrayOutputStream
      Throws:
      IOException
    • getBuffer

      public final byte[] getBuffer()
      Returns the written buffer value as a modifiable byte array.
    • isClosed

      public final boolean isClosed()
      Returns whether the output stream has been closed.