Package com.hazelcast.config
Class ConfigStream
java.lang.Object
java.io.InputStream
com.hazelcast.config.ConfigStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Stream wrapping or copying a generic
InputStream
for the
ConfigRecognizer
API. The purpose of this class is to make
the provided InputStream
resetable so that multiple
ConfigRecognizer
implementations can iterate over the stream.
There are even basic InputStream
implementations that don't
support InputStream.reset()
such as BufferedInputStream
.
If calling reset()
on the provided implementation fails with
an exception, this class reads the stream into a byte[]
and
delegates all InputStream
method calls to a
ByteArrayInputStream
created with this byte[]
. To
prevent OOM issues, the size of this byte[]
is limited to 4096
bytes. This limit can be configured in the constructor.- See Also:
-
Constructor Summary
ConstructorDescriptionConfigStream
(InputStream configStream) ConfigStream
(InputStream configStream, int readLimit) -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ConfigStream
- Throws:
IOException
-
ConfigStream
- Throws:
IOException
-
-
Method Details
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-