classafBson::BsonReader

sys::Obj
  afBson::BsonReader

Wraps an InStream to read BSON objects.

Note that Binary objects with a subtype of BIN_GENERIC will be read and returned as a Buf.

in

Source

InStream in { private set }

The underlying InStream.

make

Source

new make(InStream in)

Creates a BsonReader, wrapping the given InSteam. As per the BSON spec, the stream's endian is to little.

readCString

Source

Str readCString()

Reads a (null terminated) BSON String from the underlying InStream.

readDocument

Source

Str:Obj? readDocument()

Reads a BSON Document from the underlying InStream.

readInteger32

Source

Int readInteger32()

Reads a BSON Integer32 from the underlying InStream.

readInteger64

Source

Int readInteger64()

Reads a BSON Integer64 from the underlying InStream.

tz

Source

TimeZone tz := TimeZone.cur

The TimeZone in which all DateTimes are returned in.

This does not change the instant in the date time continuum, just time zone it is reported in. This lets a stored date time of 12 Dec 2012 18:00 UTC be returned as 12 Dec 2012 13:00 New_York.