@Override
    public StatusOutputStream<Void> write(final Path file, final TransferStatus status, final ConnectionCallback callback) {
        final OutputStream putStream = session.getClient().putAsOutputStream(file.getAbsolute());
        return new VoidStatusOutputStream(putStream);
    }
@Test
    public void testWriteUnknownLength() throws Exception {
        final MantaWriteFeature feature = new MantaWriteFeature(session);
        final Path container = randomDirectory();
        new MantaDirectoryFeature(session).mkdir(container, new TransferStatus());
        final byte[] content = RandomUtils.nextBytes(5 * 1024 * 1024);

        final TransferStatus status = new TransferStatus();
        status.setLength(-1L);
        final Path file = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        final StatusOutputStream<Void> out = feature.write(file, status, new DisabledConnectionCallback());
        final ByteArrayInputStream in = new ByteArrayInputStream(content);
        final int alloc = 1024;
        final byte[] buffer = new byte[alloc];
        assertEquals(content.length, IOUtils.copyLarge(in, out, buffer));
        out.close();
        final PathAttributes found = new MantaAttributesFinderFeature(session).find(file);
        assertEquals(found.getSize(), content.length);
        new MantaDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }