Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3ObjectInputStream skip is inefficient #797

Closed
yagyesha opened this issue Jul 29, 2016 · 3 comments
Closed

S3ObjectInputStream skip is inefficient #797

yagyesha opened this issue Jul 29, 2016 · 3 comments

Comments

@yagyesha
Copy link

I working on implementing S3 download framework with resume support. When using S3ObjectInputStream while downloading an object, I had to skip bytes in order to support resume of previously broken downloads. Calling skip() on S3ObjectInputStream takes forever (if the file is big) & it seems it is simply using the default skip() implementation. Here is what documentation says about default implementation:

The skip method of this class creates a byte array and then repeatedly reads into it until n bytes have been read or the end of the stream has been reached. Subclasses are encouraged to provide a more efficient implementation of this method. For instance, the implementation may depend on the ability to seek.

Is there a way i can efficiently seek to a specific position when using S3ObjectInputStream? Or is there any other alternative?

@manikandanrs
Copy link
Contributor

@yagyesha
Copy link
Author

Thanks for quick response. GetObjectRequest setRange was exactly what i was looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants