Esempio n. 1
0
        public int ReadLength()
        {
            CheckDisposed();

            var value = (int)_lengthDecoder.Read();

            Debug.Assert(value >= 0);
            return(value);
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public string Read()
        {
            CheckDisposed();

            int length = (int)_lengthDecoder.Read();

            if (length == 0)
            {
                return(string.Empty);
            }

            var result = _value.Substring(_pos, length);

            _pos += length;

            // No need to keep the string in memory anymore.
            // This also covers the case when nothing but empty strings are left.
            if (_pos >= _value.Length)
            {
                _value = null;
            }

            return(result);
        }
Esempio n. 3
0
 public uint ReadTypeRef()
 {
     CheckDisposed();
     return(_typeRefDecoder.Read());
 }
Esempio n. 4
0
 public ID ReadLeftId()
 {
     CheckDisposed();
     return(new ID((int)_clientDecoder.Read(), _leftClockDecoder.Read()));
 }