@gmod/cram 4.0.7 → 4.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,7 @@
34
34
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
35
  */
36
36
 
37
- import bzip2 from 'bzip2'
37
+ import Bunzip from 'seek-bzip'
38
38
 
39
39
  import RangeCoder from './arith_sh'
40
40
  import ByteModel from './byte_model'
@@ -154,18 +154,7 @@ export default class RangeCoderGen {
154
154
  // ----------------------------------------------------------------------
155
155
  // External codec
156
156
  decodeExt(stream, n_out) {
157
- const bits = bzip2.array(stream.buf.slice(stream.pos))
158
- let size = bzip2.header(bits)
159
- let chunk
160
- const chunks = []
161
- do {
162
- chunk = bzip2.decompress(bits, size)
163
- if (chunk !== -1) {
164
- chunks.push(chunk)
165
- size -= chunk.length
166
- }
167
- } while (chunk !== -1)
168
- return concatUint8Array(chunks)
157
+ return Bunzip.decode(stream.buf.slice(stream.pos))
169
158
  }
170
159
 
171
160
  // ----------------------------------------------------------------------