File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import org .bson .types .ObjectId ;
2222
2323/**
24- * TODO Documentation
24+ * A callback interface for describing the structure of a BSON document.
2525 */
2626public interface BSONCallback {
2727
Original file line number Diff line number Diff line change 2020import java .io .InputStream ;
2121
2222/**
23- * TODO Documentation
23+ * An interface for decoders of BSON documents.
2424 */
2525public interface BSONDecoder {
2626
27+ /**
28+ * Read a single BSON object from the given bytes.
29+ *
30+ * @param bytes the bytes in BSON format
31+ * @return the BSON object for the given bytes
32+ */
2733 BSONObject readObject (byte [] bytes );
2834
35+ /**
36+ * Read a single BSON object from the given input stream.
37+ *
38+ * @param in the input stream in BSON format
39+ * @return the BSON object for the given bytes
40+ */
2941 BSONObject readObject (InputStream in ) throws IOException ;
3042
43+ /**
44+ * Decode a single BSON object into the given callback from the given byte array.
45+ *
46+ * @param bytes the bytes in BSON format
47+ * @param callback the callback
48+ * @return the number of bytes in the BSON object
49+ */
3150 int decode (byte [] bytes , BSONCallback callback );
3251
52+ /**
53+ * Decode a single BSON object into the given callback from the given input stream.
54+ *
55+ * @param in the input stream in BSON format
56+ * @param callback the callback
57+ * @return the number of bytes read from the input tream
58+ * @throws IOException
59+ */
3360 int decode (InputStream in , BSONCallback callback ) throws IOException ;
3461}
Original file line number Diff line number Diff line change 3434import java .util .regex .Pattern ;
3535
3636/**
37- * TODO Documentation
37+ * An implementation of {@code BsonCallback} that creates an instance of BSONObject.
3838 */
3939public class BasicBSONCallback implements BSONCallback {
4040
You can’t perform that action at this time.
0 commit comments