public FileReferenceData(FileReference fileReference, String filename, Type type, CompressionType compressionType) {
        this.fileReference = fileReference;
        this.filename = filename;
        this.type = type;
        this.compressionType = compressionType;
    }
@Test
    public void testFileReferenceData() throws IOException {
        String content = "blobbblubbblabb";
        File file = writeTempFile(content);
        FileReferenceData fileReferenceData =
                new LazyFileReferenceData(new FileReference("ref"), "foo", Type.compressed, file, CompressionType.gzip);
        ByteBuffer byteBuffer = ByteBuffer.allocate(10);
        assertEquals(10, fileReferenceData.nextContent(byteBuffer));
        assertEquals(content.substring(0,10), Utf8.toString(Arrays.copyOfRange(byteBuffer.array(), 0, 10)));
        byteBuffer.flip();
        assertEquals(5, fileReferenceData.nextContent(byteBuffer));
        assertEquals(content.substring(10,15), Utf8.toString(Arrays.copyOfRange(byteBuffer.array(), 0, 5)));

        // nextContent() will always return everything for FileReferenceDataBlob, so nothing more should be read
        assertEquals(-1, fileReferenceData.nextContent(byteBuffer));
        assertTrue(file.exists());
        fileReferenceData.close();
        assertTrue(file.exists()); // file should not be removed
    }