Class BsonReader
Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data.
Implements
Inherited Members
Namespace: Bayat.Json.Bson
Assembly: Bayat.Json.Runtime.dll
Syntax
public class BsonReader : JsonReader, IDisposable
Constructors
| Improve this Doc View SourceBsonReader(BinaryReader)
Initializes a new instance of the BsonReader class.
Declaration
public BsonReader(BinaryReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | reader | The reader. |
BsonReader(BinaryReader, Boolean, DateTimeKind)
Initializes a new instance of the BsonReader class.
Declaration
public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryReader | reader | The reader. |
System.Boolean | readRootValueAsArray | if set to |
System.DateTimeKind | dateTimeKindHandling | The System.DateTimeKind used when reading System.DateTime values from BSON. |
BsonReader(Stream)
Initializes a new instance of the BsonReader class.
Declaration
public BsonReader(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
BsonReader(Stream, Boolean, DateTimeKind)
Initializes a new instance of the BsonReader class.
Declaration
public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
System.Boolean | readRootValueAsArray | if set to |
System.DateTimeKind | dateTimeKindHandling | The System.DateTimeKind used when reading System.DateTime values from BSON. |
Properties
| Improve this Doc View SourceDateTimeKindHandling
Gets or sets the System.DateTimeKind used when reading System.DateTime values from BSON.
Declaration
public DateTimeKind DateTimeKindHandling { get; set; }
Property Value
Type | Description |
---|---|
System.DateTimeKind | The System.DateTimeKind used when reading System.DateTime values from BSON. |
JsonNet35BinaryCompatibility
Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary.
Declaration
[Obsolete("JsonNet35BinaryCompatibility will be removed in a future version of Json.NET.")]
public bool JsonNet35BinaryCompatibility { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ReadRootValueAsArray
Gets or sets a value indicating whether the root object will be read as a JSON array.
Declaration
public bool ReadRootValueAsArray { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
| Improve this Doc View SourceClose()
Changes the JsonReader.State to Closed.
Declaration
public override void Close()
Overrides
| Improve this Doc View SourceRead()
Reads the next JSON token from the stream.
Declaration
public override bool Read()
Returns
Type | Description |
---|---|
System.Boolean | true if the next token was read successfully; false if there are no more tokens to read. |