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
Testable extension for a byte array output stream.
- Since:
- 1.14
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Whether the output stream has been closed.Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.ByteArrayOutputStream
reset, size, toByteArray, toString, toString, toString, write, write, writeTo
Methods inherited from class java.io.OutputStream
flush, write
-
Field Details
-
closed
private boolean closedWhether the output stream has been closed.
-
-
Constructor Details
-
TestableByteArrayOutputStream
public TestableByteArrayOutputStream()
-
-
Method Details
-
close
Overriding is supported, but overriding method must call the super implementation.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classByteArrayOutputStream
- 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.
-