Package org.opendaylight.raft.spi
Interface StreamSource
- All Known Subinterfaces:
SizedStreamSource,UnsizedStreamSource
- All Known Implementing Classes:
AbstractFileStreamSource,ByteArray,FileStreamSource,TransientFileStreamSource
@NonNullByDefault
public sealed interface StreamSource
permits UnsizedStreamSource, SizedStreamSource
Interface capturing the ability to open
InputStreams.-
Method Summary
Modifier and TypeMethodDescriptiondefault InputStreamOpen anInputStreamwhich is reasonably buffered for small accesses.default DataInputStreamOpen aDataInputStream, performing buffering overopenStream()if needed.Open anInputStream.Return theSizedStreamSourceequivalent of thisStreamSource.
-
Method Details
-
openStream
Open anInputStream.- Returns:
- an InputStream
- Throws:
IOException- if an I/O error occurs
-
openBufferedStream
Open anInputStreamwhich is reasonably buffered for small accesses. Default implementation defers toopenStream().- Returns:
- an InputStream
- Throws:
IOException- if an I/O error occurs
-
toSizedStreamSource
Return theSizedStreamSourceequivalent of thisStreamSource.- Returns:
- the
SizedStreamSourceequivalent of thisStreamSource - Throws:
IOException- if an I/O error occurs
-
openDataInput
Open aDataInputStream, performing buffering overopenStream()if needed.- Returns:
- a
DataInputStream - Throws:
IOException- if an I/O error occurs
-