From RAD Studio API Documentation
Jump to: navigation, search



TBsonReader = class(TJsonReader)


class PASCALIMPLEMENTATION TBsonReader : public System::Json::Readers::TJsonReader


Type Visibility Source Unit Parent
class public


Class to read data serialized in BSON format.

To read BSON data:

  1. Create a BSON reader that reads data from a data stream.
  2. Call Read so that the reader moves to the first BSON token of the input data.
  3. Keep calling Read to go through all the BSON tokens of the input data. Read returns False when it reaches the end of the input data.
  4. When you are finished reading the input data, you can either close or destroy the reader.

Instead of Read, you may alternatively use any of the following reading methods if you can anticipate the type of the next token:

TJsonTextReader also provides some additional features:

  • CloseInput determines whether the reader closes the stream reader that provides the input data when you close the reader (True) or not (False).
  • Reader provides access to the underlying binary reader that the BSON reader uses.
  • Rewind resets the reader to the state that it has when you create it, but it does not rewind the stream reader that provides the input data.

See Also