Class TestableByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- com.google.api.client.testing.util.TestableByteArrayInputStream
-
-
Field Summary
Fields Modifier and Type Field Description private booleanclosedWhether the input stream has been closed.
-
Constructor Summary
Constructors Constructor Description TestableByteArrayInputStream(byte[] buf)TestableByteArrayInputStream(byte[] buf, int offset, int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()byte[]getBuffer()Returns the written buffer value as a modifiable byte array.booleanisClosed()Returns whether the output stream has been closed.
-
-
-
Constructor Detail
-
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 Detail
-
close
public void close() throws java.io.IOExceptionOverriding is supported, but overriding method must call the super implementation.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.ByteArrayInputStream- Throws:
java.io.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.
-
-