Comments (2)
Ah, that means I misunderstood how it works and need to do some more debugging. Thanks for taking a look!
from compression.
As specced, when the compressed data comes from the network, the browser has to decompress it all and enqueue the decompressed chunks.
Can you show me how you are using the stream? TransformStreams are not supposed to consume greedily and has highWaterMark=1, meaning it's only allowed to have one single unconsumed chunk and then stops processing until it's read.
With the following demo it only reads the first chunk and wait.
// A string "HELLO"
let buffer = [
new Uint8Array([31,139,8,0,0]),
new Uint8Array([0,0,0,0,10]),
new Uint8Array([243,112,245,241,241]),
new Uint8Array([7,0,54,100,68,193,5,0,0,0]),
];
let index = 0;
let r = new ReadableStream({
pull(controller) {
if (index >= buffer.length) {
controller.close();
return;
}
console.log("pulled", index);
controller.enqueue(buffer[index]);
++index;
},
type: "bytes"
});
let d = new DecompressionStream("gzip");
let pipe = r.pipeThrough(d);
Please correct me if I misunderstood your issue.
from compression.
Related Issues (20)
- Compress arraybuffer example HOT 1
- Readable byte stream HOT 2
- Standards home? HOT 19
- Include brotli HOT 16
- Shipping status? (Unity3D use cases) HOT 1
- Blocking APIs in Workers? HOT 1
- Get unused data from end of DecompressionStream? HOT 4
- Support for decompressing multi-member gzip files? HOT 1
- Getting snappy over Snappy
- Handling of trailing data after deflate-raw final block HOT 4
- Use enum for `format` parameter? HOT 4
- Why TypeError instead of DOMException DataError for decompression failure? HOT 3
- Should the spec allow enqueueing on-the-go instead of storing them until the input is exhausted? HOT 1
- zstd support HOT 7
- Resolved Promises of WritableStreamDefaultWriter Methods HOT 1
- On-demand flush HOT 3
- SSL certificate error HOT 2
- The served document is still in W3C style HOT 1
- Conformance should be in terms of Infra
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compression.