Package org.opendaylight.raft.spi
Class AbstractFileStreamSource
java.lang.Object
org.opendaylight.raft.spi.AbstractFileStreamSource
- All Implemented Interfaces:
SizedStreamSource,StreamSource
- Direct Known Subclasses:
FileStreamSource,TransientFileStreamSource
@NonNullByDefault
public abstract sealed class AbstractFileStreamSource
extends Object
implements SizedStreamSource
permits TransientFileStreamSource, FileStreamSource
A
SizedStreamSource providing access to a slice of a regular file, similar to a ByteBuffer.-
Method Summary
Modifier and TypeMethodDescriptionabstract Pathfile()Returns this source's file path.final longlimit()Returns the limit.final InputStreamOpen anInputStreamwhich is reasonably buffered for small accesses.final InputStreamOpen anInputStream.final longposition()Returns the starting position.final longsize()Returns the size of this data source, which is to say the number of bytes available for reading from the stream returned byStreamSource.openStream().final StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opendaylight.raft.spi.SizedStreamSource
toSizedStreamSourceMethods inherited from interface org.opendaylight.raft.spi.StreamSource
openDataInput
-
Method Details
-
file
Returns this source's file path.- Returns:
- this source's file path
-
position
public final long position()Returns the starting position.- Returns:
- the starting position
-
limit
public final long limit()Returns the limit.- Returns:
- the limit
-
openStream
Description copied from interface:StreamSourceOpen anInputStream.- Specified by:
openStreamin interfaceStreamSource- Returns:
- an InputStream
- Throws:
IOException- if an I/O error occurs
-
openBufferedStream
Description copied from interface:StreamSourceOpen anInputStreamwhich is reasonably buffered for small accesses. Default implementation defers toStreamSource.openStream().- Specified by:
openBufferedStreamin interfaceStreamSource- Returns:
- an InputStream
- Throws:
IOException- if an I/O error occurs
-
size
public final long size()Description copied from interface:SizedStreamSourceReturns the size of this data source, which is to say the number of bytes available for reading from the stream returned byStreamSource.openStream().- Specified by:
sizein interfaceSizedStreamSource- Returns:
- the size of this data source
-
toString
-