'Decompress compressed UTF16 value.'

def decode(self):

    hi = self.enc_byte()
    flagbits = 0
    while (self.encpos < len(self.encdata)):
        if (flagbits == 0):
            flags = self.enc_byte()
            flagbits = 8
        flagbits -= 2
        t = ((flags >> flagbits) & 3)
        if (t == 0):
            self.put(self.enc_byte(), 0)
        elif (t == 1):
            self.put(self.enc_byte(), hi)
        elif (t == 2):
            self.put(self.enc_byte(), self.enc_byte())
        else:
            n = self.enc_byte()
            if (n & 128):
                c = self.enc_byte()
                for _ in range(((n & 127) + 2)):
                    lo = ((self.std_byte() + c) & 255)
                    self.put(lo, hi)
            else:
                for _ in range((n + 2)):
                    self.put(self.std_byte(), 0)
    return self.buf.decode('utf-16le', 'replace')
