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

Request InputStream/SeekableStream Media Downloader #647

Closed
wonderfly opened this issue Jan 10, 2015 · 1 comment
Closed

Request InputStream/SeekableStream Media Downloader #647

wonderfly opened this issue Jan 10, 2015 · 1 comment
Assignees
Labels
imported priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@wonderfly
Copy link
Contributor

From nherr...@google.com on October 16, 2012 13:54:11

External references, such as a standards document, or specification? http://docs.oracle.com/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/com/sun/media/jai/codec/SeekableStream.html http://docs.oracle.com/javase/1.3/docs/api/java/io/InputStream.html Java environments (e.g. Java 6, Android 2.3, App Engine, or All)? Java 6, non-App Engine (at least for large requests) Please describe the feature requested. Instead of having an output sink to write bytes into, an app might prefer to have an input stream to read bytes out of, possibly making non-sequential access and multiple underlying HTTP requests to the web API for the data, and have it all happen just-in-time with some caching policy (i.e., cache all the file data, none of the data, last n KB of requests) and some capture policy (e.g., always the most recent version, or locked to a particular version & throw an exception otherwise -- using If-Match to ensure).

It would be great if you could turn a resource id into a SeekableStream that would then not make any requests for data until someone calls read on it. It would be nice if it also had knobs for caching (cache all reads | last n B of reads | only in m B chunks | preload all | preload first l B) and for resource expiration (e.g., if the resource is modified/deleted and the SeekableStream has to go to the service for more data -- perhaps it throws some kind of exception in those cases, or rather it flows gracefully to the next version) and handles all the retryable failures that might transpire (using the retry policy).

Original issue: http://code.google.com/p/google-api-java-client/issues/detail?id=633

@wonderfly wonderfly added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. imported priority: p2 Moderately-important priority. Fix may not be included in next release. 2–5 stars labels Jan 10, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on October 16, 2012 15:11:09

Added executeMediaAsInputStream() that returns java.io.InputStream that should help with part of this: https://codereview.appspot.com/6725045/ I also filed a feature request to specify the Range header in HttpMediaDownloader https://code.google.com/p/google-api-java-client/issues/detail?id=634 Of course you can also just call getRequestHeaders().setRange("bytes=100-199")

With respect to SeekableStream: can you please provide sample code that demonstrates how this might be used with respect to HTTP requests? I'm not familiar with this. Without really investigating this, my gut feeling is this may be outside the scope of what we may want to provide in this library.

Status: Accepted
Owner: rmis...@google.com
Cc: yan...@google.com
Labels: Component-Media

@wonderfly wonderfly self-assigned this Jan 10, 2015
@wonderfly wonderfly removed their assignment May 19, 2016
@JustinBeckwith JustinBeckwith self-assigned this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants