Class TestableByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- com.google.api.client.testing.util.TestableByteArrayInputStream
-
- All Implemented Interfaces:
Closeable
@Beta public class TestableByteArrayInputStream extends ByteArrayInputStream
Beta
Testable extension for a byte array input stream.- Since:
- 1.14
- Author:
- Yaniv Inbar
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
-
-
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 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.ByteArrayInputStream
available, mark, markSupported, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
read
-
-
-
-
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 IOException
Overriding is supported, but overriding method must call the super implementation.
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in 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.
-
-