Skip to content

Commit 3f7ca6b

Browse files
committed
Added some Javadoc in org.bson
1 parent 12e8975 commit 3f7ca6b

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

driver/src/main/org/bson/BSONCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.bson.types.ObjectId;
2222

2323
/**
24-
* TODO Documentation
24+
* A callback interface for describing the structure of a BSON document.
2525
*/
2626
public interface BSONCallback {
2727

driver/src/main/org/bson/BSONDecoder.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,42 @@
2020
import java.io.InputStream;
2121

2222
/**
23-
* TODO Documentation
23+
* An interface for decoders of BSON documents.
2424
*/
2525
public 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
}

driver/src/main/org/bson/BasicBSONCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import java.util.regex.Pattern;
3535

3636
/**
37-
* TODO Documentation
37+
* An implementation of {@code BsonCallback} that creates an instance of BSONObject.
3838
*/
3939
public class BasicBSONCallback implements BSONCallback {
4040

0 commit comments

Comments
 (0)