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
InputStream
s.-
Method Summary
Modifier and TypeMethodDescriptiondefault InputStream
Open anInputStream
which is reasonably buffered for small accesses.default DataInputStream
Open aDataInputStream
, performing buffering overopenStream()
if needed.Open anInputStream
.Return theSizedStreamSource
equivalent of thisStreamSource
.
-
Method Details
-
openStream
Open anInputStream
.- Returns:
- an InputStream
- Throws:
IOException
- if an I/O error occurs
-
openBufferedStream
Open anInputStream
which is reasonably buffered for small accesses. Default implementation defers toopenStream()
.- Returns:
- an InputStream
- Throws:
IOException
- if an I/O error occurs
-
toSizedStreamSource
Return theSizedStreamSource
equivalent of thisStreamSource
.- Returns:
- the
SizedStreamSource
equivalent 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
-