public class BasicBSONEncoder extends java.lang.Object implements BSONEncoder
Constructor and Description |
---|
BasicBSONEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
done()
Free the resources.
|
byte[] |
encode(BSONObject document)
Encode a document into byte array.
|
int |
putObject(BSONObject document)
Encodes a
BSONObject . |
void |
set(OutputBuffer buffer)
Sets the buffer to wrich the result of encoding will be written.
|
public byte[] encode(BSONObject document)
BSONEncoder
OutputBuffer
,
invokes the other 3 methods in a corresponding sequence:
and returns the contents of the OutputBuffer
.encode
in interface BSONEncoder
document
- the document to be encodedpublic void done()
BSONEncoder
done
in interface BSONEncoder
public void set(OutputBuffer buffer)
BSONEncoder
set
in interface BSONEncoder
buffer
- the buffer to be used to write a byte sequences topublic int putObject(BSONObject document)
BSONObject
. This is for the higher level api calls.putObject
in interface BSONEncoder
document
- the document to encodeCopyright © 2010 - 2020 Adobe. All Rights Reserved