Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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
            }));
        }