CborReader.SlideData(ReadOnlyMemory<Byte>, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Replaces the buffer with data that continues from the reader's current position, preserving the nesting context.
public:
void SlideData(ReadOnlyMemory<System::Byte> data, bool isFinalBlock);
public void SlideData(ReadOnlyMemory<byte> data, bool isFinalBlock);
member this.SlideData : ReadOnlyMemory<byte> * bool -> unit
Public Sub SlideData (data As ReadOnlyMemory(Of Byte), isFinalBlock As Boolean)
Parameters
- data
- ReadOnlyMemory<Byte>
The CBOR-encoded data to continue reading from. It must start with the unconsumed bytes of the previous buffer (see BytesRemaining), followed by any newly available data.
- isFinalBlock
- Boolean
true to indicate that data contains the complete remainder of the document(s) to read;
false if more data may be supplied by a subsequent call to this method.
Exceptions
The reader's current data was supplied as the final block.
data is shorter than the unconsumed bytes of the current buffer (see BytesRemaining).
Remarks
The caller is responsible for preserving all unread bytes, in order, at the beginning of data. Only the length of the new buffer is validated, not its contents.
NOTE: Some members, such as ReadEncodedValue(Boolean), return a ReadOnlyMemory<T> as a slice over the input buffer. Callers are responsible for preserving the integrity of those values for as long as they are persisted. When using CborReader in streaming mode, callers are advised to read such values immediately, make defensive copies, or avoid reusing the same memory across calls to SlideData.
Calling this method after a complete document has been read does not resume reading; the reader continues to report Finished. Use Reset(ReadOnlyMemory<Byte>, Boolean) to begin reading a new document.