Add inputstream/outputstream for handling big binary


#1

I m trying to save a big file receicing chunks dinamically. Now i can make it converting it in a Blob … but it means all data is in memory. it is not a best practice and it dont work for big files It would be necessary to add a inputstream/outputstream so i can append chunks dinamically and the saver can save it using i fixed memory space . The same is for the object Response. I d like pass in constructor a inputstream so i can simulate a http chunks response.


#2

Perhaps the streams API is what you need.


#3

yes thanks . I hope Firefox Edge will implement fastly them


#4

If you need support today, Firefox supports XHR streaming with responseType = 'moz-chunked-arraybuffer', and IE supports it with responseType = 'ms-stream'.


#5

We did some initial work on streams. I don’t expect us to implement until next year or the year after, however.


#6

I saw there is a problem with stream designed by w3c.

scenario 1) i want call a url and receive a stream object for parsing chunks. I wont load all in one. now it is impossible scenario 2) i want save a video stream but now the recorderd stream is a blob (considering a video can be long as you want in memory) you can create easly a crash of the mobile or pc .

Too many objects for doing a simple thing: to read a stream and when exist you cant do waht you want


#7

sincerely your proposal is technical not architectural … so you will return on the same problem with other technologies. the problem is simple. i dont mind if is ajax , websocket or a magic lbrary … The browser expects a object of a specific prototype … permitting to append chunk for sending or receice chunk for receiver . It is very simple to implement . It works everywhere with any techonlogy and it is robust. I need just var stream=new Stream() new Response(stream) stream.appendChunck(chunk) I want save a stream from a request ? i want preprocess a input file? I want save a video stream ? it is simple stream.onData=function(chunk,isLast){ do something … }

This permits also to solve a big problem in all browsers to handle streams using Blob concept that is not really really really a good pragmatical pratice. It permits out of memory programmatically !


#8

You are right , i have the same problem in my project. I don t know how to save a video stream. I cant use Media Recorder … it creates a big file in memory … just for little video.


#9

There is websocket performing better for streams instead of ajax ms-stream the problem is not how to receive a stream from server but how to pass a stream to server from a client stream . I m thinking above all about video/audio stream


#10

We have a platform that produces and edits video. We have been waiting for a year to save audio streams on our servers without using complex proprietary solutions. Hopefully w3c will soon offer us a way to save streams using chunks