class LockedSegmentFileInputFactory implements SegmentFileInputFactory {
    /** Holder of actual information of latest manipulation on WAL segments. */
    private final SegmentAware segmentAware;

    /** Manager of segment location. */
    private final SegmentRouter segmentRouter;

    /** {@link FileIO} factory definition.*/
    private final FileIOFactory fileIOFactory;

    /**
     * @param segmentAware Holder of actual information of latest manipulation on WAL segments.
     * @param segmentRouter Manager of segment location.
     * @param fileIOFactory {@link FileIO} factory definition.
     */
    public LockedSegmentFileInputFactory(
        SegmentAware segmentAware,
        SegmentRouter segmentRouter,
        FileIOFactory fileIOFactory) {
        this.segmentAware = segmentAware;
        this.segmentRouter = segmentRouter;
        this.fileIOFactory = fileIOFactory;
    }

    /** {@inheritDoc} */
    @Override public FileInput createFileInput(SegmentIO segmentIO, ByteBufferExpander buf) throws IOException {<FILL_FUNCTION_BODY>}
}

        return new LockedReadFileInput(
            buf,
            segmentIO,
            segmentAware,
            id -> {
                FileDescriptor segment = segmentRouter.findSegment(id);

                return segment.toReadOnlyIO(fileIOFactory);
            }
        );
    
<no_super_class>