public int ReadLength() { CheckDisposed(); var value = (int)_lengthDecoder.Read(); Debug.Assert(value >= 0); return(value); }
/// <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); }
public uint ReadTypeRef() { CheckDisposed(); return(_typeRefDecoder.Read()); }
public ID ReadLeftId() { CheckDisposed(); return(new ID((int)_clientDecoder.Read(), _leftClockDecoder.Read())); }