public string Decode(BitArray code, out int codeLength) { var index = 0; var dict = CodesDictionaryCoder.GetDictionary(code, ref index); codeLength = code.Length - index; return(TextDecode(code, index, dict)); }
private BitArray GetCode(string text, Dictionary <char, BitArray> codesDictionary, out int codeLength) { var dictionaryCode = CodesDictionaryCoder.GetCode(codesDictionary); var textCode = TextCode(text, codesDictionary); codeLength = textCode.Length; return(BitArrayConverter.ConvertToBitArray(new List <BitArray>() { dictionaryCode, textCode })); }