Class TestableByteArrayInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
com.google.api.client.testing.util.TestableByteArrayInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Beta Testable extension for a byte array input stream.
- Since:
- 1.14
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether the input stream has been closed.Fields inherited from class ByteArrayInputStream
buf, count, mark, pos -
Constructor Summary
ConstructorsConstructorDescriptionTestableByteArrayInputStream(byte[] buf) TestableByteArrayInputStream(byte[] buf, int offset, int length) -
Method Summary
Methods inherited from class ByteArrayInputStream
available, mark, markSupported, read, read, reset, skipMethods inherited from class InputStream
read
-
Field Details
-
closed
private boolean closedWhether the input stream has been closed.
-
-
Constructor Details
-
TestableByteArrayInputStream
public TestableByteArrayInputStream(byte[] buf) - Parameters:
buf- buffer
-
TestableByteArrayInputStream
public TestableByteArrayInputStream(byte[] buf, int offset, int length) - Parameters:
buf- bufferoffset- offset in the buffer of the first byte to readlength- maximum number of bytes to read from the buffer
-
-
Method Details
-
close
Overriding is supported, but overriding method must call the super implementation.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classByteArrayInputStream- 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.
-