Esempio n. 1
0
 internal InternalFIWriter(Stream output, FIWriterVocabulary vocabulary)
 {
     _encoder          = new FIEncoder(output, vocabulary);
     _namespaceManager = new NamespaceManager();
     _element          = new FIEncoder.FIElement();
     _hasElement       = false;
     _hasAttribute     = false;
 }
Esempio n. 2
0
 internal FIVocabulary(Uri uri)
 {
     // create restricted encoding and alphabet managers and propogate into child vocabularies
     _encodingAlgorithmManager  = new FIEncodingAlgorithmManager();
     _restrictedAlphabetManager = new FIRestrictedAlphabetManager();
     _reader = new FIReaderVocabulary(_encodingAlgorithmManager, _restrictedAlphabetManager);
     _writer = new FIWriterVocabulary(uri, _encodingAlgorithmManager, _restrictedAlphabetManager);
 }
Esempio n. 3
0
        internal FIEncoder(Stream output, FIWriterVocabulary vocabulary)
        {
            _output = output;
            if (vocabulary != null)
            {
                // copy initial vocabulary
                _vocabulary = new FIWriterVocabulary(vocabulary);
            }

            _terminateElement    = false;
            _terminateAttributes = false;
            _terminateDTD        = false;

            _encodingBuffer       = new byte[1024]; // 1K
            _encodingBufferLength = 0;
        }
Esempio n. 4
0
        internal void WriteHeader()
        {
            // append FastInfoset magic number and version
            byte[] header = { 0xE0, 0, 0, 0x01 };
            _output.Write(header, 0, 4);

            // append optional components
            if (_vocabulary == null)
            {
                // no optional components
                _vocabulary = new FIWriterVocabulary();
                _output.WriteByte((byte)0x0);
            }
            else
            {
                WriteOptionalComponents();
            }
        }
Esempio n. 5
0
		internal FIWriterVocabulary(FIWriterVocabulary vocab)
		{
			// copy constructor
			_encodingAlgorithmManager = vocab._encodingAlgorithmManager;
			_restrictedAlphabetManager = vocab._restrictedAlphabetManager;

			_attributeNamesMap = new QNameArray(vocab._attributeNamesMap);
			_attributeValuesMap = new Dictionary<string,int>(vocab._attributeValuesMap);
			_elementNamesMap = new QNameArray(vocab._elementNamesMap);
			_contentCharacterChunksMap = new Dictionary<string,int>(vocab._contentCharacterChunksMap);
			_localNamesMap = new Dictionary<string,int>(vocab._localNamesMap);
			_namespaceNamesMap = new Dictionary<string,int>(vocab._namespaceNamesMap);
			_prefixNamesMap = new Dictionary<string,int>(vocab._prefixNamesMap);
			_otherNCNamesMap = new Dictionary<string, int>(vocab._otherNCNamesMap);
			_otherStringMap = new Dictionary<string, int>(vocab._otherStringMap);

			_uri = vocab._uri;
			_stringEncoding = vocab._stringEncoding;
		}