@classmethod
def value_from_buffer(cls, bfr, encoding):
    """ Read a NUL terminated UTF-16 string from `bfr`, return field.
        The mandatory parameter `encoding` specifies the UTF16 encoding to use
        (`'utf_16_be'` or `'utf_16_le'`).
    """
    bs_length = 2
    while True:
        bfr.extend(bs_length)
        nul_pos = bs_length - 2
        if bfr[nul_pos] == 0 and bfr[nul_pos + 1] == 0:
            break
        bs_length += 2
    if nul_pos == 0:
        utf16 = ''
    else:
        utf16_bs = bfr.take(nul_pos)
        utf16 = utf16_bs.decode(encoding)
    bfr.take(2)
    return utf16
