Class Bson
java.lang.Object
com.codename1.backend.mongo.Bson
BSON, the binary document format MongoDB stores and speaks.
| Java | BSON |
|---|---|
Double, Float |
double |
String |
string |
Map |
embedded document (key order kept) |
List, Object[] |
array |
byte[] |
binary, generic subtype |
ObjectId |
ObjectId |
Boolean |
boolean |
Date |
UTC datetime |
null |
null |
Integer, Short, Byte |
int32 |
Long |
int64 |
Decoding reads documents into LinkedHashMap, arrays into ArrayList, a
timestamp as its Long and a Decimal128 as its sixteen raw bytes in a
Bson.Decimal128Bytes; other legacy types are refused.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA Decimal128 value, kept as the sixteen little-endian bytes the server sent: this runtime has noBigDecimalto decode it into. -
Method Summary
-
Method Details
-
encode
One document as BSON. -
decode
The document these bytes hold.- Throws:
IOException
-
decode
The document atoffset, which must span exactlylengthbytes.- Throws:
IOException
-