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
ConstructorsConstructorDescriptionConfigStream(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:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-