Re: File API Feedback

On Mon, Jul 6, 2009 at 1:38 PM, Jonas Sicking<jonas@sicking.cc> wrote:
> So what if you're reading two parts of the file and want different
> callbacks. Say for example that you're reading data out of a video
> file and you want to read both the index of the video to see how long
> it is, as well as read read the first frame in order to display a
> preview. Once we have an API for reading ranges of a file, you'd do:
>
> file.getDataAtRange(0, 1024, indexHandler, genericError);
> file.getDataAtRange(4711, 5735, indexHandler, genericError);
>
> (the example assumes that the index is located at byte 0, and the
> first video frame is located at byte 4711).
>
> How would you do that using the API you are proposing?

Oops, sorry, there's a copy-n-paste error in the above. It should read:

file.getDataAtRange(0, 1024, indexHandler, genericError);
file.getDataAtRange(4711, 5735, showFrameHandler, genericError);

/ Jonas

Received on Monday, 6 July 2009 20:42:13 UTC