Slice stream function for node backend
Acceptance Criteria
- [ ] The method should receive start position, end position
- [ ] I am able to seek a file to a specific location and then read N bytes from it
- [ ] I am able to return seek position as a stream
If we are using the browser's File API, at least for browser this is not needed because File.slice() is already available and does the job.
I am not sure about Node support, but if we want to have node support, we need to provide some kind of unified API - maybe the best approach would be to use something like this that emulates File API on Node.
If we are using the browser's
FileAPI, at least for browser this is not needed becauseFile.slice()is already available and does the job.I am not sure about Node support, but if we want to have node support, we need to provide some kind of unified API - maybe the best approach would be to use something like this that emulates
FileAPI on Node.
I don't think this is a priority at the moment, right?
Node support should be quite straightforward since we have a simple stream API (right?).
@risenW I'm not yet clear why we need slice vs basic stream() method we already had (node streams allow one to read chunk by chunk). Can you give more info on slice vs stream and why we need slice?
@risenW I'm not yet clear why we need slice vs basic
stream()method we already had (node streams allow one to read chunk by chunk). Can you give more info onslicevsstreamand why we need slice?
This is not needed anymore I think. It was a backup in case the streaming upload didn't work. But since it has already been fixed, we do not need this anymore.
And yes, after my research as well I found out that node file stream has a start and end parameter that we can use. If needed, we can just create a simple function on top of it.