BsonReader ClassMongoDB C# Driver API Documentation
Represents a BSON reader for some external format (see subclasses).
Inheritance Hierarchy

SystemObject
  MongoDB.Bson.IOBsonReader
    MongoDB.Bson.IOBsonBinaryReader
    MongoDB.Bson.IOBsonDocumentReader
    MongoDB.Bson.IOJsonReader

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: { version: '1.11.0.92', semver: '1.11.0', commit: '791a16588d4a8b3b118a8b3b57cfa436fec5d3da', commitDate: '2015-12-08 22:55:45' }
Syntax

public abstract class BsonReader : IDisposable

The BsonReader type exposes the following members.

Constructors

  NameDescription
Protected methodBsonReader
Initializes a new instance of the BsonReader class.
Top
Methods

  NameDescription
Public methodClose
Closes the reader.
Public methodStatic memberCreate(Stream)
Creates a BsonReader for a BSON Stream.
Public methodStatic memberCreate(TextReader)
Creates a BsonReader for a JSON TextReader.
Public methodStatic memberCreate(String)
Creates a BsonReader for a JSON string.
Public methodStatic memberCreate(BsonBuffer)
Creates a BsonReader for a BsonBuffer.
Public methodStatic memberCreate(BsonDocument)
Creates a BsonReader for a BsonDocument.
Public methodStatic memberCreate(JsonBuffer)
Creates a BsonReader for a JsonBuffer.
Public methodStatic memberCreate(Stream, BsonBinaryReaderSettings)
Creates a BsonReader for a BSON Stream.
Public methodStatic memberCreate(BsonBuffer, BsonBinaryReaderSettings)
Creates a BsonReader for a BsonBuffer.
Public methodStatic memberCreate(BsonDocument, BsonDocumentReaderSettings)
Creates a BsonReader for a BsonDocument.
Public methodStatic memberCreate(JsonBuffer, JsonReaderSettings)
Creates a BsonReader for a JsonBuffer.
Public methodDispose
Disposes of any resources used by the reader.
Protected methodDispose(Boolean)
Disposes of any resources used by the reader.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindElement
Positions the reader to an element by name.
Public methodFindStringElement
Positions the reader to a string element by name.
Public methodGetBookmark
Gets a bookmark to the reader's current position and state.
Public methodGetCurrentBsonType
Gets the current BsonType (calls ReadBsonType if necessary).
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReadBinaryData
Reads BSON binary data from the reader.
Public methodReadBinaryData(String)
Reads a BSON binary data element from the reader.
Public methodReadBinaryData(Byte, BsonBinarySubType) Obsolete.
Reads BSON binary data from the reader.
Public methodReadBinaryData(Byte, BsonBinarySubType, GuidRepresentation) Obsolete.
Reads BSON binary data from the reader.
Public methodReadBinaryData(String, Byte, BsonBinarySubType) Obsolete.
Reads a BSON binary data element from the reader.
Public methodReadBinaryData(String, Byte, BsonBinarySubType, GuidRepresentation) Obsolete.
Reads a BSON binary data element from the reader.
Public methodReadBoolean
Reads a BSON boolean from the reader.
Public methodReadBoolean(String)
Reads a BSON boolean element from the reader.
Public methodReadBsonType
Reads a BsonType from the reader.
Public methodReadBsonTypeTValue(BsonTrieTValue, Boolean, TValue)
Reads a BsonType from the reader.
Public methodReadBytes
Reads BSON binary data from the reader.
Public methodReadBytes(String)
Reads a BSON binary data element from the reader.
Public methodReadDateTime
Reads a BSON DateTime from the reader.
Public methodReadDateTime(String)
Reads a BSON DateTime element from the reader.
Public methodReadDouble
Reads a BSON Double from the reader.
Public methodReadDouble(String)
Reads a BSON Double element from the reader.
Public methodReadEndArray
Reads the end of a BSON array from the reader.
Public methodReadEndDocument
Reads the end of a BSON document from the reader.
Public methodReadInt32
Reads a BSON Int32 from the reader.
Public methodReadInt32(String)
Reads a BSON Int32 element from the reader.
Public methodReadInt64
Reads a BSON Int64 from the reader.
Public methodReadInt64(String)
Reads a BSON Int64 element from the reader.
Public methodReadJavaScript
Reads a BSON JavaScript from the reader.
Public methodReadJavaScript(String)
Reads a BSON JavaScript element from the reader.
Public methodReadJavaScriptWithScope
Reads a BSON JavaScript with scope from the reader (call ReadStartDocument next to read the scope).
Public methodReadJavaScriptWithScope(String)
Reads a BSON JavaScript with scope element from the reader (call ReadStartDocument next to read the scope).
Public methodReadMaxKey
Reads a BSON MaxKey from the reader.
Public methodReadMaxKey(String)
Reads a BSON MaxKey element from the reader.
Public methodReadMinKey
Reads a BSON MinKey from the reader.
Public methodReadMinKey(String)
Reads a BSON MinKey element from the reader.
Public methodReadName
Reads the name of an element from the reader.
Public methodReadName(String)
Reads the name of an element from the reader.
Public methodReadNull
Reads a BSON null from the reader.
Public methodReadNull(String)
Reads a BSON null element from the reader.
Public methodReadObjectId
Reads a BSON ObjectId from the reader.
Public methodReadObjectId(String)
Reads a BSON ObjectId element from the reader.
Public methodReadObjectId(Int32, Int32, Int16, Int32) Obsolete.
Reads a BSON ObjectId from the reader.
Public methodReadObjectId(String, Int32, Int32, Int16, Int32) Obsolete.
Reads a BSON ObjectId element from the reader.
Public methodReadRawBsonArray
Reads a raw BSON array.
Public methodReadRawBsonArray(String)
Reads a raw BSON array.
Public methodReadRawBsonDocument
Reads a raw BSON document.
Public methodReadRawBsonDocument(String)
Reads a raw BSON document.
Public methodReadRegularExpression
Reads a BSON regular expression from the reader.
Public methodReadRegularExpression(String)
Reads a BSON regular expression element from the reader.
Public methodReadRegularExpression(String, String) Obsolete.
Reads a BSON regular expression from the reader.
Public methodReadRegularExpression(String, String, String) Obsolete.
Reads a BSON regular expression element from the reader.
Public methodReadStartArray
Reads the start of a BSON array.
Public methodReadStartDocument
Reads the start of a BSON document.
Public methodReadString
Reads a BSON string from the reader.
Public methodReadString(String)
Reads a BSON string element from the reader.
Public methodReadSymbol
Reads a BSON symbol from the reader.
Public methodReadSymbol(String)
Reads a BSON symbol element from the reader.
Public methodReadTimestamp
Reads a BSON timestamp from the reader.
Public methodReadTimestamp(String)
Reads a BSON timestamp element from the reader.
Public methodReadUndefined
Reads a BSON undefined from the reader.
Public methodReadUndefined(String)
Reads a BSON undefined element from the reader.
Public methodReturnToBookmark
Returns the reader to previously bookmarked position and state.
Public methodSkipName
Skips the name (reader must be positioned on a name).
Public methodSkipValue
Skips the value (reader must be positioned on a value).
Protected methodThrowInvalidContextType
Throws an InvalidOperationException when the method called is not valid for the current ContextType.
Protected methodThrowInvalidState
Throws an InvalidOperationException when the method called is not valid for the current state.
Protected methodThrowObjectDisposedException
Throws an ObjectDisposedException.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodVerifyBsonType
Verifies the current state and BsonType of the reader.
Protected methodVerifyName
Verifies the name of the current element.
Top
Extension Methods

  NameDescription
Public Extension MethodToBson(Type)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBson(Type, IBsonSerializationOptions, BsonBinaryWriterSettings)Overloaded.
Converts an object to a BSON document byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson(Type, IBsonSerializationOptions, JsonWriterSettings)Overloaded.
Converts an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
Properties

  NameDescription
Public propertyCurrentBsonType
Gets the current BsonType.
Protected propertyCurrentName
Gets the current name.
Protected propertyDisposed
Gets whether the BsonReader has been disposed.
Public propertySettings
Gets the settings of the reader.
Public propertyState
Gets the current state of the reader.
Top
See Also

Reference