Class MutableByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- org.apache.flink.formats.avro.utils.MutableByteArrayInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class MutableByteArrayInputStream extends ByteArrayInputStream
An extension of the ByteArrayInputStream that allows to change a buffer that should be read without creating a new ByteArrayInputStream instance. This allows to re-use the same InputStream instance, copying message to process, and creation of Decoder on every new message.
-
-
Field Summary
-
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
-
-
Constructor Summary
Constructors Constructor Description MutableByteArrayInputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setBuffer(byte[] buf)
Set buffer that can be read via the InputStream interface and reset the input stream.-
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, readAllBytes, readNBytes, reset, skip, transferTo
-
Methods inherited from class java.io.InputStream
nullInputStream, read, readNBytes
-
-