Class BsonBinaryReader
Represents a BSON reader for a binary BSON byte array.
public class BsonBinaryReader : BsonReader, IBsonReader, IDisposable
- Inheritance
-
BsonBinaryReader
- Implements
- Inherited Members
- Extension Methods
Constructors
BsonBinaryReader(Stream)
Initializes a new instance of the BsonBinaryReader class.
public BsonBinaryReader(Stream stream)
Parameters
stream
StreamA stream (BsonBinary does not own the stream and will not Dispose it).
BsonBinaryReader(Stream, BsonBinaryReaderSettings)
Initializes a new instance of the BsonBinaryReader class.
public BsonBinaryReader(Stream stream, BsonBinaryReaderSettings settings)
Parameters
stream
StreamA stream (BsonBinary does not own the stream and will not Dispose it).
settings
BsonBinaryReaderSettingsA BsonBinaryReaderSettings.
Properties
BaseStream
Gets the base stream.
public Stream BaseStream { get; }
Property Value
- Stream
The base stream.
BsonStream
Gets the BSON stream.
public BsonStream BsonStream { get; }
Property Value
- BsonStream
The BSON stream.
Settings
Gets the settings of the writer.
public BsonBinaryReaderSettings Settings { get; }
Property Value
Methods
Close()
Closes the reader.
public override void Close()
Dispose(bool)
Disposes of any resources used by the reader.
protected override void Dispose(bool disposing)
Parameters
disposing
boolTrue if called from Dispose.
GetBookmark()
Gets a bookmark to the reader's current position and state.
public override BsonReaderBookmark GetBookmark()
Returns
- BsonReaderBookmark
A bookmark.
IsAtEndOfFile()
Determines whether this reader is at end of file.
public override bool IsAtEndOfFile()
Returns
- bool
Whether this reader is at end of file.
ReadBinaryData()
Reads BSON binary data from the reader.
public override BsonBinaryData ReadBinaryData()
Returns
- BsonBinaryData
A BsonBinaryData.
ReadBoolean()
Reads a BSON boolean from the reader.
public override bool ReadBoolean()
Returns
- bool
A Boolean.
ReadBsonType()
Reads a BsonType from the reader.
public override BsonType ReadBsonType()
Returns
- BsonType
A BsonType.
ReadBytes()
Reads BSON binary data from the reader.
public override byte[] ReadBytes()
Returns
- byte[]
A byte array.
ReadDateTime()
Reads a BSON DateTime from the reader.
public override long ReadDateTime()
Returns
- long
The number of milliseconds since the Unix epoch.
ReadDecimal128()
Reads a BSON Decimal128 from the reader.
public override Decimal128 ReadDecimal128()
Returns
ReadDouble()
Reads a BSON Double from the reader.
public override double ReadDouble()
Returns
- double
A Double.
ReadEndArray()
Reads the end of a BSON array from the reader.
public override void ReadEndArray()
ReadEndDocument()
Reads the end of a BSON document from the reader.
public override void ReadEndDocument()
ReadInt32()
Reads a BSON Int32 from the reader.
public override int ReadInt32()
Returns
- int
An Int32.
ReadInt64()
Reads a BSON Int64 from the reader.
public override long ReadInt64()
Returns
- long
An Int64.
ReadJavaScript()
Reads a BSON JavaScript from the reader.
public override string ReadJavaScript()
Returns
- string
A string.
ReadJavaScriptWithScope()
Reads a BSON JavaScript with scope from the reader (call ReadStartDocument next to read the scope).
public override string ReadJavaScriptWithScope()
Returns
- string
A string.
ReadMaxKey()
Reads a BSON MaxKey from the reader.
public override void ReadMaxKey()
ReadMinKey()
Reads a BSON MinKey from the reader.
public override void ReadMinKey()
ReadName(INameDecoder)
Reads the name of an element from the reader.
public override string ReadName(INameDecoder nameDecoder)
Parameters
nameDecoder
INameDecoderThe name decoder.
Returns
- string
The name of the element.
ReadNull()
Reads a BSON null from the reader.
public override void ReadNull()
ReadObjectId()
Reads a BSON ObjectId from the reader.
public override ObjectId ReadObjectId()
Returns
- ObjectId
An ObjectId.
ReadRawBsonArray()
Reads a raw BSON array.
public override IByteBuffer ReadRawBsonArray()
Returns
- IByteBuffer
The raw BSON array.
ReadRawBsonDocument()
Reads a raw BSON document.
public override IByteBuffer ReadRawBsonDocument()
Returns
- IByteBuffer
The raw BSON document.
ReadRegularExpression()
Reads a BSON regular expression from the reader.
public override BsonRegularExpression ReadRegularExpression()
Returns
- BsonRegularExpression
A BsonRegularExpression.
ReadStartArray()
Reads the start of a BSON array.
public override void ReadStartArray()
ReadStartDocument()
Reads the start of a BSON document.
public override void ReadStartDocument()
ReadString()
Reads a BSON string from the reader.
public override string ReadString()
Returns
- string
A String.
ReadSymbol()
Reads a BSON symbol from the reader.
public override string ReadSymbol()
Returns
- string
A string.
ReadTimestamp()
Reads a BSON timestamp from the reader.
public override long ReadTimestamp()
Returns
- long
The combined timestamp/increment.
ReadUndefined()
Reads a BSON undefined from the reader.
public override void ReadUndefined()
ReturnToBookmark(BsonReaderBookmark)
Returns the reader to previously bookmarked position and state.
public override void ReturnToBookmark(BsonReaderBookmark bookmark)
Parameters
bookmark
BsonReaderBookmarkThe bookmark.
SkipName()
Skips the name (reader must be positioned on a name).
public override void SkipName()
SkipValue()
Skips the value (reader must be positioned on a value).
public override void SkipValue()