Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

SeekableByteChannel that doesn't use a temp file #103

@sbeimin

Description

@sbeimin

The current implementation of S3SeekableByteChannel makes use of a temp file. This has a couple of drawbacks. One of the primary reasons to use a SeekableByteChannel is that you do not want to 'download' an entire (2GB) file if you are only interested in a specific range of bytes within the file.

Why do we have a separate S3SeekableByteChannel next to S3FileChannel? S3FileChannel extends java.nio.channels.FileChannel which in turn implements java.nio.channels.SeekableByteChannel.

Another problem is the use of Files.createTempFile(). This generally creates a file in /tmp (on linux e.g.) which can be seen as a security risk if the file contains sensitive data.

The com.amazonaws.services.s3.model.GetObjectRequest supports a private long[] range; which enables the retrieval of a limited range of bytes. Perhaps this could be used to create a better SeekableByteChannel implementation.

However I can't find any option to write a limited range of bytes to an S3 Object... Perhaps we'll have to wait and see that the 2.0 version of the AWS SDK offers us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions