The statistics for the results, if present. These are only present on the last RPC
response from the server. They can be observed while that final response is being consumed, or afterwards.
A task which, when completed, will contain the metadata for the stream.
HasDataAsync(CancellationToken)
public Task<bool> HasDataAsync(CancellationToken cancellationToken)
Determines whether this stream has any more data or not.
This is equivalent to calling NextAsync(CancellationToken) to see whether the return
value is null, but without consuming the value from the stream.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eReliableStreamReader\u003c/code\u003e class is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, but there are multiple prior versions available ranging from \u003ccode\u003e3.5.0\u003c/code\u003e to \u003ccode\u003e5.0.0-beta04\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eReliableStreamReader\u003c/code\u003e provides streaming access to a Spanner SQL query, handling retries, chunking, and recoverable errors.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReliableStreamReader\u003c/code\u003e class allows asynchronous operations, such as ensuring initialization, retrieving metadata, checking for data, and reading the next value, using cancellation tokens.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides properties to check the stream status, such as \u003ccode\u003eIsClosed\u003c/code\u003e, and access result statistics through \u003ccode\u003eStats\u003c/code\u003e, along with methods for managing the stream, such as \u003ccode\u003eClose()\u003c/code\u003e and \u003ccode\u003eDispose()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eStreamClosed\u003c/code\u003e event is invoked when the stream gets closed, providing an event handler for stream closure notifications.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class ReliableStreamReader (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.ReliableStreamReader)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.ReliableStreamReader) \n\n public sealed class ReliableStreamReader : IDisposable\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class ReliableStreamReader.\n\nProvides streaming access to a Spanner SQL query that automatically retries, handles\nchunking and recoverable errors. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ReliableStreamReader \n\nImplements\n----------\n\n[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nProperties\n----------\n\n### IsClosed\n\n public bool IsClosed { get; }\n\nIndicates whether the reader is closed or not.\n\n### Stats\n\n public ResultSetStats Stats { get; }\n\nThe statistics for the results, if present. These are only present on the last RPC\nresponse from the server. They can be observed while that final response is being consumed, or afterwards.\n\nMethods\n-------\n\n### Close()\n\n public void Close()\n\nCloses the stream reader.\n\n### Dispose()\n\n public void Dispose()\n\n### EnsureInitializedAsync(CancellationToken)\n\n public Task EnsureInitializedAsync(CancellationToken cancellationToken)\n\nEnsures the stream reader is initialized, i.e. that the request has been executed and we've received\nappropriate metadata.\n\n### \\~ReliableStreamReader()\n\n protected ~ReliableStreamReader()\n\n### GetMetadataAsync(CancellationToken)\n\n public Task\u003cResultSetMetadata\u003e GetMetadataAsync(CancellationToken cancellationToken)\n\nAsynchronously retrieves the metadata associated with this stream.\n\n### HasDataAsync(CancellationToken)\n\n public Task\u003cbool\u003e HasDataAsync(CancellationToken cancellationToken)\n\nDetermines whether this stream has any more data or not.\nThis is equivalent to calling [NextAsync(CancellationToken)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReliableStreamReader#Google_Cloud_Spanner_V1_ReliableStreamReader_NextAsync_System_Threading_CancellationToken_) to see whether the return\nvalue is null, but without consuming the value from the stream.\n\n### NextAsync(CancellationToken)\n\n public Task\u003cValue\u003e NextAsync(CancellationToken cancellationToken)\n\nAsynchronously reads the next value from the stream. A null value indicates the end of the stream.\n\nEvents\n------\n\n### StreamClosed\n\n public event EventHandler\u003cStreamClosedEventArgs\u003e StreamClosed\n\nEvent invoked when the stream is closed."]]