Java可擴展的BSON編碼和解碼器:ebson

jopen 9年前發布 | 16K 次閱讀 ebson JSON開發包

一個采用Java開發,可擴展的BSON編碼和解碼器,擁有一個可拔插的 Java-to-BSON 類型映射。
</div>

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();

項目主頁:http://www.baiduhome.net/lib/view/home/1433232858650

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!