示例#1
0
        /// <summary>
        /// Reads the compressed text data
        /// </summary>
        private void ReadCompressedTextData()
        {
            if (Length > 0)
            {
                using (DjvuReader reader = GetTextDataReader(_dataLocation))
                {
                    int    length    = (int)reader.ReadUInt24BigEndian();
                    byte[] textBytes = reader.ReadBytes(length);
                    TextBytes  = textBytes;
                    Text       = Encoding.UTF8.GetString(textBytes);
                    TextLength = _text.Length;
                    Version    = reader.ReadByte();

                    Zone = new TextZone(reader, null, null, this);
                }
            }
            _isDecoded = true;

            /* if (Length == 0) return;
             *
             * using (DjvuReader reader = GetTextDataReader(_dataLocation))
             * {
             *   _textLength = (int)reader.ReadUInt24BigEndian();
             *   byte[] textBytes = reader.ReadBytes(_textLength);
             *   _text = Encoding.UTF8.GetString(textBytes);
             *   if (_text.Contains("предварительной"))
             *   {
             *
             *   }
             *
             *
             *
             *   _version = reader.ReadByte();
             *   _textLength = _text.Length;
             *
             *   _zone = new TextZone(reader, null, null, this);
             * }
             *
             * _isDecoded = true;*/
        }