@Override
    public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            final DownloadBuilder builder = new DbxUserFilesRequests(session.getClient(file))
                    .downloadBuilder(containerService.getKey(file)).withRev(file.attributes().getVersionId());
            if(status.isAppend()) {
                final HttpRange range = HttpRange.withStatus(status);
                builder.range(range.getStart());
            }
            final DbxDownloader<FileMetadata> downloader = builder.start();
            return downloader.getInputStream();
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Download {0} failed", e, file);
        }
    }
@Test
    public void testReadInterrupt() throws Exception {
        final DropboxWriteFeature write = new DropboxWriteFeature(session);
        final TransferStatus writeStatus = new TransferStatus();
        final byte[] content = RandomUtils.nextBytes(66800);
        writeStatus.setLength(content.length);
        final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        final OutputStream out = write.write(test, writeStatus, new DisabledConnectionCallback());
        assertNotNull(out);
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
        // Unknown length in status
        final TransferStatus readStatus = new TransferStatus();
        // Read a single byte
        {
            final InputStream in = new DropboxReadFeature(session).read(test, readStatus, new DisabledConnectionCallback());
            assertNotNull(in.read());
            in.close();
        }
        {
            final InputStream in = new DropboxReadFeature(session).read(test, readStatus, new DisabledConnectionCallback());
            assertNotNull(in);
            in.close();
        }
        new DropboxDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }