public class BasicBSONEncoder extends Object implements BSONEncoder
| Modifier and Type | Field and Description |
|---|---|
protected org.bson.io.OutputBuffer |
_buf |
| Constructor and Description |
|---|
BasicBSONEncoder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_put(byte type,
String name)
Encodes the type and key.
|
protected int |
_put(String str)
puts as utf-8 string
|
protected void |
_putObjectField(String name,
Object val) |
protected void |
_putValueString(String s) |
void |
done() |
byte[] |
encode(BSONObject o) |
byte[] |
encode(BSONObject o,
BSONObject extendObj) |
protected boolean |
handleSpecialObjects(String name,
BSONObject o) |
protected void |
putBinary(String name,
Binary val) |
protected void |
putBinary(String name,
byte[] data) |
protected void |
putBoolean(String name,
Boolean b) |
protected void |
putBSONDate(String name,
BSONDate d) |
protected void |
putCode(String name,
Code code) |
protected void |
putCodeWScope(String name,
CodeWScope code) |
protected void |
putDate(String name,
Date d) |
protected void |
putDecimal(String name,
BSONDecimal decimal) |
protected void |
putNull(String name) |
protected void |
putNumber(String name,
Number n) |
int |
putObject(BSONObject o)
Encodes a
BSONObject. |
int |
putObject(BSONObject o,
BSONObject extendObj) |
protected int |
putObject(String name,
BSONObject o,
BSONObject extendObj)
this is really for embedded objects
|
protected void |
putObjectId(String name,
ObjectId oid) |
protected boolean |
putSpecial(String name,
Object o) |
protected void |
putString(String name,
String s) |
protected void |
putSymbol(String name,
Symbol s) |
protected void |
putTimestamp(String name,
BSONTimestamp ts) |
protected void |
putUndefined(String name) |
protected void |
putUUID(String name,
UUID val) |
void |
set(org.bson.io.OutputBuffer out) |
void |
writeCString(String s) |
void |
writeInt(int x) |
void |
writeLong(long x) |
protected void _put(byte type,
String name)
protected int _put(String str)
protected void _putValueString(String s)
public void done()
done in interface BSONEncoderpublic byte[] encode(BSONObject o)
encode in interface BSONEncoderpublic byte[] encode(BSONObject o, BSONObject extendObj)
encode in interface BSONEncoderprotected boolean handleSpecialObjects(String name, BSONObject o)
protected void putBinary(String name, byte[] data)
protected void putCodeWScope(String name, CodeWScope code)
protected void putDecimal(String name, BSONDecimal decimal)
protected void putNull(String name)
public int putObject(BSONObject o)
BSONObject. This is for the higher level api callsputObject in interface BSONEncodero - the object to encodepublic int putObject(BSONObject o, BSONObject extendObj)
putObject in interface BSONEncoderprotected int putObject(String name, BSONObject o, BSONObject extendObj)
protected void putTimestamp(String name, BSONTimestamp ts)
protected void putUndefined(String name)
public void set(org.bson.io.OutputBuffer out)
set in interface BSONEncoderpublic void writeCString(String s)
public void writeInt(int x)
public void writeLong(long x)
Copyright © 2023. All rights reserved.