JsonCharReader

Namespace: SnowBank.Data.Json · struct

Implements: IJsonReader

JSON Text reader that wraps an in-memory buffer of characters

Constructors

JsonCharReader

JsonCharReader(Char* buffer, int count, bool autoDetectBom = true)

Create a new char reader from an unmanaged memory buffer

  • buffer — Buffer containing decoded characters
  • count — Size (in characters) of the buffer
  • autoDetectBom — If true, skip the BOM if found ('\xFEFF')

Properties

Consumed

int Consumed { get; }

Number of characters consumed from the start

HasMore

bool? HasMore { get; }

Returns true if there are more characters to read

Remaining

int? Remaining { get; }

Returns the number of remaining characters that are still available

Methods

Read

int Read()

Returns the next character in the source, or -1 if no more characters are available