Akka.Interfaced.ProtobufSerializer.SerializeExtensions.ReadString C# (CSharp) Метод

ReadString() публичный статический Метод

public static ReadString ( this stream ) : string
stream this
Результат string
        public static string ReadString(this Stream stream)
        {
            var length = stream.Read7BitEncodedInt();
            if (length == 0)
            {
                return null;
            }
            else if (length == 1)
            {
                return string.Empty;
            }
            else
            {
                var bytes = new byte[length - 1];
                stream.Read(bytes, 0, length - 1);
                return Encoding.UTF8.GetString(bytes);
            }
        }
    }