Dart DocumentationbsonBsonDate

BsonDate class

class BsonDate extends BsonObject{
 DateTime data;
 BsonDate(this.data);
 get value => data;
 byteLength() => 8;
 int get typeByte => _BSON_DATA_DATE;
 packValue(BsonBinary buffer){
    buffer.writeInt64(data.millisecondsSinceEpoch);
 }
 unpackValue(BsonBinary buffer){
    data = new DateTime.fromMillisecondsSinceEpoch(buffer.readInt64());
 }
}

Extends

BsonObject > BsonDate

Constructors

new BsonDate(DateTime data) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
BsonDate(this.data);

Properties

DateTime data #

DateTime data

final int typeByte #

int get typeByte => _BSON_DATA_DATE;

final value #

get value => data;

Methods

dynamic byteLength() #

byteLength() => 8;

dynamic packElement(String name, buffer) #

inherited from BsonObject
packElement(String name, var buffer){
 buffer.writeByte(typeByte);
 if (name != null){
   new BsonCString(name).packValue(buffer);
 }
 packValue(buffer);
}

dynamic packValue(BsonBinary buffer) #

packValue(BsonBinary buffer){
  buffer.writeInt64(data.millisecondsSinceEpoch);
}

_ElementPair unpackElement(buffer) #

inherited from BsonObject
_ElementPair unpackElement(buffer){
 _ElementPair result = new _ElementPair();
 result.name = buffer.readCString();
 unpackValue(buffer);
 result.value = value;
 return result;
}

dynamic unpackValue(BsonBinary buffer) #

unpackValue(BsonBinary buffer){
  data = new DateTime.fromMillisecondsSinceEpoch(buffer.readInt64());
}