ebsonBSON 的 Java 開發(fā)包
ebson 是一個可擴(kuò)展的 BSON 文檔 Java 開發(fā)包。
Maven:
<dependency> <groupId>com.github.kohanyirobert</groupId> <artifactId>ebson</artifactId> <version>...</version> </dependency>
示例代碼:
// create documents to serialize
BsonDocument document = BsonDocuments.of("key", new Date());
// grab a little-endian byte buffer
ByteBuffer buffer = ByteBuffer.allocate(32).order(ByteOrder.LITTLE_ENDIAN);
// use the documents utility class to write the document into the buffer
BsonDocuments.writeTo(buffer, document);
// use the serialized data
buffer.flip();評論
圖片
表情
