@staticmethod
def _decode(frame, tab):
    """Decode a frame with the help of the table."""
    blocks = []
    while frame:
        length, endseq = tab[frame[0]]
        blocks.extend([frame[1:length], endseq])
        frame = frame[length:]
    if blocks and len(blocks[-1]) > 0:
        blocks[-1] = blocks[-1][:-1]
    return ''.join(blocks)
