Download an object's last n bytes #2030
Labels
api: storage
Issues related to the googleapis/java-storage API.
type: question
Request for information or clarification. Not an issue.
Downloading objects via byte ranges is supported (https://cloud.google.com/storage/docs/samples/storage-download-byte-range). However, seeking the channel does not work when I need to download the last n bytes of an object.
This is supported in the HTTP Range header with a negative value, describing the suffix length. (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range).
Ideally I would like to give another parameter to download, an option object describing that or a new RangeReader.
Is this feature already implemented?
Describe alternatives you've considered
A possible workaround could be to first get the size and use this to get the start position. This is not ideal, as it would require two HTTP requests.
Additional context
In Go this was already discussed and implemented (googleapis/google-cloud-go#1540). However, I am not sure, if the seekable channel would support something like this.
The text was updated successfully, but these errors were encountered: