ebsonBSON 的 Java 开发包
ebson 是一个可扩展的 BSON 文档 Java 开发包。
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();评论
