Decompress the chunk of data.

        :param bytes chunk: data chunk

        :rtype: bytes
18543
def decompress(self, chunk):
        

        try:
            return self._decompressobj.decompress(chunk)
        except zlib.error:
            # ugly hack to work with raw deflate content that may
            # be sent by microsoft servers. For more information, see:
            # http://carsten.codimi.de/gzip.yaws/
            # http://www.port80software.com/200ok/archive/2005/10/31/868.aspx
            # http://www.gzip.org/zlib/zlib_faq.html#faq38
            if self._first_chunk:
                self._decompressobj = zlib.decompressobj(-zlib.MAX_WBITS)
                return self._decompressobj.decompress(chunk)

            raise
        finally:
            self._first_chunk = False
65359
public void decompress(ByteBuffer src, ByteBuffer dest) {
    final int destLen = getDecompressedLength(src, src.position());
    final int read = decompressor.decompress(src, src.position() + 4, dest, dest.position(), destLen);
    src.position(src.position() + 4 + read);
    dest.position(dest.position() + destLen);
  }
1269641
function decompress(compressedSize, b) {
	"use strict";
	var n = 0,
		r = 0,
		f = 0,
		s = 8,
		p = s,
		i = 0;
	var dst = new Buffer(compressedSize);
	var d = 12;
	var aa = new Int32Array(256);
	while (s < dst.length) {
		if (!i) {
			f = b[d++];
			i = 1;
		}
		if (f & i) {
			r = aa[b[d++]];
			dst[s++] = dst[r++];
			dst[s++] = dst[r++];
			n = 0xff & b[d++];
			for (var m = 0; m < n; m++) {
				dst[s + m] = dst[r + m];
			}
		} else {
			dst[s++] = b[d++];
		}
		while (p < (s - 1)) {
			aa[dst[p] ^ dst[p + 1]] = p++;
		}
		if (f & i) {
			p = (s += n);
		}
		i *= 2;
		if (i === 256) {
			i = 0;
		}
	}
	return dst;
}
715281
def _decompress_data(self, data):
        ''''''
        if self._decompressor:
            try:
                return self._decompressor.decompress(data)
            except zlib.error as error:
                raise ProtocolError(
                    'zlib error: {0}.'.format(error)
                ) from error
        else:
            return data
459293
def decompress(data, format=FORMAT_AUTO, memlimit=None, filters=None):
    
    results = []
    while True:
        decomp = LZMADecompressor(format, memlimit, filters)
        try:
            res = decomp.decompress(data)
        except LZMAError:
            if results:
                break  # Leftover data is not a valid LZMA/XZ stream; ignore it.
            else:
                raise  # Error on the first iteration; bail out.
        results.append(res)
        if not decomp.eof:
            raise LZMAError("Compressed data ended before the "
                            "end-of-stream marker was reached")
        data = decomp.unused_data
        if not data:
            break
    return b"".join(results)
939074
def xz_decompress_stream(src):
    
    dec = lzma.LZMADecompressor()
    for block in src:
        decoded = dec.decompress(block)
        if decoded:
            yield decoded

    if dec.unused_data:  # pragma: nocover; can't figure out how to test this
        raise IOError('Read unused data at end of compressed stream')
715203
function decompress( buffer ) {

  var chunks = []
  var chunkType = ADC.CHUNK_UNKNOWN
  var position = 0
  var length = 0

  windowOffset = 0

  while( position < buffer.length ) {
    chunkType = ADC.getChunkType( buffer[ position ] )
    length = ADC.getSequenceLength( buffer[ position ] )
    switch( chunkType ) {
      case ADC.CHUNK_DATA:
        chunks.push( decodeData( window, buffer, position ) )
        break
      case ADC.CHUNK_THREE:
        chunks.push( decodeRunlength( window, buffer, position ) )
        break
      case ADC.CHUNK_TWO:
        chunks.push( decodeRunlength( window, buffer, position ) )
        break
      default:
        throw new Error( 'Unknown chunk type 0x' + buffer[ position ].toString(16) + ' at ' + position )
    }
    position += length
  }

  return Buffer.concat( chunks )

}
101619
def decompress(chunks, compression):
    

    if compression not in SUPPORTED_COMPRESSIONS:
        raise TypeError('Unsupported compression type: %s' % (compression,))

    de_compressor = DECOMPRESSOR_FACTORIES[compression]()
    try:
        for chunk in chunks:
            try:
                yield de_compressor.decompress(chunk)
            except OSError as err:
                # BZ2Decompressor: invalid data stream
                raise DecompressError(err) from None

        # BZ2Decompressor does not support flush() method.
        if hasattr(de_compressor, 'flush'):
            yield de_compressor.flush()

    except zlib.error as err:
        raise DecompressError(err) from None
707270
def write(self, chunk):
        """"""
        if self.chunked_write and chunk:
            buf = [hex(len(chunk))[2:], CRLF, chunk, CRLF]
            self.conn.wfile.sendall("".join(buf))
        else:
            self.conn.wfile.sendall(chunk)
589900
def write(self, chunk, offset):
        
        return lib.zfile_write(self._as_parameter_, chunk, offset)
320516
def decompress(data):
    
    d = Decompressor()
    data = d.decompress(data)
    d.finish()
    return data
680702
def decompress(self, data):
		""""""

		decompressed = ""
		pos = 0
		while pos < len(data):
			currentChar = data[pos]
			if currentChar != self.referencePrefix:
				decompressed += currentChar
				pos += 1
			else:
				nextChar = data[pos + 1]
				if nextChar != self.referencePrefix:
					distance = self.__decodeReferenceInt(data[pos + 1 : pos + 3], 2)
					length = self.__decodeReferenceLength(data[pos + 3])
					start = len(decompressed) - distance - length
					end = start + length
					decompressed += decompressed[start : end]
					pos += self.minStringLength - 1
				else:
					decompressed += self.referencePrefix
					pos += 2

		return decompressed
1096370
function LZ4_uncompress (input, options) {
	var output = []
	var decoder = new Decoder(options)

	decoder.on('data', function (chunk) {
		output.push(chunk)
	})

	decoder.end(input)

	return Buffer.concat(output)
}
205709
def compress(data):
    

    if isinstance(data, bytes):
        source = data
    elif isinstance(data, str):
        source = bytes(data, encoding='utf-8')
    else:
        raise RuntimeError("Compression is only supported for strings and bytes")

    return base64.b64encode(gzip.compress(source))
881403
def send_bytes(self, bytes):
        
        try:
            self.socket.send(bytes)
            log.debug("TO PEER: %r\n", bytes)
        except socket.error:
            self.disconnect("Connection reset by peer.")
449140
def decode(self, bytes):
        
        opcode  = struct.unpack(">H", bytes[0:2])[0]
        nbytes  = struct.unpack("B",  bytes[2:3])[0]
        name   = None
        args   = []

        if opcode in self.opcodes:
            defn = self.opcodes[opcode]
            name = defn.name
            stop = 3

            for arg in defn.argdefns:
                start = stop
                stop  = start + arg.nbytes
                if arg.fixed:
                    pass  # FIXME: Confirm fixed bytes are as expected?
                else:
                    args.append(arg.decode(bytes[start:stop]))

        return self.create(name, *args)
1219
def decompress(data):
    

    if isinstance(data, bytes):
        source = data
    elif isinstance(data, str):
        source = bytes(data, encoding='utf-8')
    else:
        raise RuntimeError("Compression is only supported for strings and bytes")

    return gzip.decompress(base64.b64decode(source))