Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

No offset option in method "openInputStream()" of "com.microsoft.azure.storage.blob.CloudBlockBlock" instance #284

Closed
helderribeirosousa opened this issue Apr 18, 2018 · 3 comments

Comments

@helderribeirosousa
Copy link

helderribeirosousa commented Apr 18, 2018

Hello,

I'm developing an application that leverages Azure's Blob Storage API for Java.
Everything went fine till i found the need to read a CloudBlob starting from a given offset.
Sure i can start reading from 0 and discard the bytes till i reach the desired offset, but this is both a major waste of network resources and impractical for large files (>300MB) with an average download speed from Azure to my server of 2.5MBps.

I need something like BlobInputStream openInputStream(long offset).

Since other blob storage providers support this, am i missing on something or is this feature not supported by Azure Storage SDK?

@rickle-msft
Copy link
Contributor

Hello!

Thank you for your patience. I think the skip method on a BlobInputStream should do the trick? Let us know if this is insufficient. http://azure.github.io/azure-storage-java/com/microsoft/azure/storage/blob/BlobInputStream.html#skip-long-

@helderribeirosousa
Copy link
Author

helderribeirosousa commented Apr 26, 2018

Thank you @rickle-msft.
I thought that method was inherited from InputStream and wasn't optimised for network usage. Looks like i should have searched for the documentation you have provided.
Still, please consider the BlobInputStream openInputStream(long offset) overload...

@rickle-msft
Copy link
Contributor

This feature has been added in the latest release of the v8 sdk. The constructor for BlobInputStream now has an overload which takes an offset and a count.

I will close this issue now as the feature has been added, but please feel free to post again if you have further requests.

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

No branches or pull requests

2 participants