@Override
    public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            final FileChannel channel = FileChannel.open(session.toPath(file), StandardOpenOption.READ);
            channel.position(status.getOffset());
            return Channels.newInputStream(channel);
        }
        catch(IOException e) {
            throw new LocalExceptionMappingService().map("Download {0} failed", e, file);
        }
    }
@Test(expected = NotfoundException.class)
    public void testReadNotFound() throws Exception {
        final LocalSession session = new LocalSession(new Host(new LocalProtocol(), new LocalProtocol().getDefaultHostname()));
        session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
        session.login(new DisabledLoginCallback(), new DisabledCancelCallback());
        final TransferStatus status = new TransferStatus();
        final Path workdir = new LocalHomeFinderFeature().find();
        new LocalReadFeature(session).read(new Path(workdir, "nosuchname", EnumSet.of(Path.Type.file)), status, new DisabledConnectionCallback());
    }