Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Node.jsの組み込みzlibモジュールを使用してバッファーを圧縮する場合、flushメソッドをどのように定義しますか?具体的には、Z_SYNC_FLUSHが必要です。このフラグを設定するオプションには場所がないようです。
http://nodejs.org/api/zlib.html
ああ、私はそれを理解しました。少しハックですが、flushプロパティを変更する必要があります。これは、他の言語でパブリッククラスプロパティを変更するのと同じようなものなので、少し汚いです。これが常に機能するかどうかはわかりませんが、私が望んでいたものが得られました。
compressor = zlib.createDeflate(); compressor._flush = zlib.Z_SYNC_FLUSH;