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
- Author:
- Yaniv Inbar
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
Constructor Summary
Constructors Constructor Description TestableByteArrayOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
byte[]
getBuffer()
Returns the written buffer value as a modifiable byte array.boolean
isClosed()
Returns whether the output stream has been closed.-
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
-
-
-
-
Method Detail
-
close
public void close() throws IOException
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.
-
-