public interface BsonWriter
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes any pending data to the output destination.
|
void |
pipe(BsonReader reader)
Reads a single document from a BsonReader and writes it to this.
|
void |
writeBinaryData(BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBinaryData(java.lang.String name,
BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBoolean(boolean value)
Writes a BSON Boolean to the writer.
|
void |
writeBoolean(java.lang.String name,
boolean value)
Writes a BSON Boolean element to the writer.
|
void |
writeDateTime(long value)
Writes a BSON DateTime to the writer.
|
void |
writeDateTime(java.lang.String name,
long value)
Writes a BSON DateTime element to the writer.
|
void |
writeDBPointer(BsonDbPointer value)
Writes a BSON DBPointer to the writer.
|
void |
writeDBPointer(java.lang.String name,
BsonDbPointer value)
Writes a BSON DBPointer element to the writer.
|
void |
writeDecimal128(Decimal128 value)
Writes a BSON Decimal128 to the writer.
|
void |
writeDecimal128(java.lang.String name,
Decimal128 value)
Writes a BSON Decimal128 element to the writer.
|
void |
writeDouble(double value)
Writes a BSON Double to the writer.
|
void |
writeDouble(java.lang.String name,
double value)
Writes a BSON Double element to the writer.
|
void |
writeEndArray()
Writes the end of a BSON array to the writer.
|
void |
writeEndDocument()
Writes the end of a BSON document to the writer.
|
void |
writeInt32(int value)
Writes a BSON Int32 to the writer.
|
void |
writeInt32(java.lang.String name,
int value)
Writes a BSON Int32 element to the writer.
|
void |
writeInt64(long value)
Writes a BSON Int64 to the writer.
|
void |
writeInt64(java.lang.String name,
long value)
Writes a BSON Int64 element to the writer.
|
void |
writeJavaScript(java.lang.String code)
Writes a BSON JavaScript to the writer.
|
void |
writeJavaScript(java.lang.String name,
java.lang.String code)
Writes a BSON JavaScript element to the writer.
|
void |
writeJavaScriptWithScope(java.lang.String code)
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeJavaScriptWithScope(java.lang.String name,
java.lang.String code)
Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeMaxKey()
Writes a BSON MaxKey to the writer.
|
void |
writeMaxKey(java.lang.String name)
Writes a BSON MaxKey element to the writer.
|
void |
writeMinKey()
Writes a BSON MinKey to the writer.
|
void |
writeMinKey(java.lang.String name)
Writes a BSON MinKey element to the writer.
|
void |
writeName(java.lang.String name)
Writes the name of an element to the writer.
|
void |
writeNull()
Writes a BSON null to the writer.
|
void |
writeNull(java.lang.String name)
Writes a BSON null element to the writer.
|
void |
writeObjectId(ObjectId objectId)
Writes a BSON ObjectId to the writer.
|
void |
writeObjectId(java.lang.String name,
ObjectId objectId)
Writes a BSON ObjectId element to the writer.
|
void |
writeRegularExpression(BsonRegularExpression regularExpression)
Writes a BSON regular expression to the writer.
|
void |
writeRegularExpression(java.lang.String name,
BsonRegularExpression regularExpression)
Writes a BSON regular expression element to the writer.
|
void |
writeStartArray()
Writes the start of a BSON array to the writer.
|
void |
writeStartArray(java.lang.String name)
Writes the start of a BSON array element to the writer.
|
void |
writeStartDocument()
Writes the start of a BSON document to the writer.
|
void |
writeStartDocument(java.lang.String name)
Writes the start of a BSON document element to the writer.
|
void |
writeString(java.lang.String value)
Writes a BSON String to the writer.
|
void |
writeString(java.lang.String name,
java.lang.String value)
Writes a BSON String element to the writer.
|
void |
writeSymbol(java.lang.String value)
Writes a BSON Symbol to the writer.
|
void |
writeSymbol(java.lang.String name,
java.lang.String value)
Writes a BSON Symbol element to the writer.
|
void |
writeTimestamp(BsonTimestamp value)
Writes a BSON Timestamp to the writer.
|
void |
writeTimestamp(java.lang.String name,
BsonTimestamp value)
Writes a BSON Timestamp element to the writer.
|
void |
writeUndefined()
Writes a BSON undefined to the writer.
|
void |
writeUndefined(java.lang.String name)
Writes a BSON undefined element to the writer.
|
void flush()
void writeBinaryData(BsonBinary binary)
binary
- The Binary data.void writeBinaryData(java.lang.String name, BsonBinary binary)
name
- The name of the element.binary
- The Binary data value.void writeBoolean(boolean value)
value
- The Boolean value.void writeBoolean(java.lang.String name, boolean value)
name
- The name of the element.value
- The Boolean value.void writeDateTime(long value)
value
- The number of milliseconds since the Unix epoch.void writeDateTime(java.lang.String name, long value)
name
- The name of the element.value
- The number of milliseconds since the Unix epoch.void writeDBPointer(BsonDbPointer value)
value
- The DBPointer to writevoid writeDBPointer(java.lang.String name, BsonDbPointer value)
name
- The name of the element.value
- The DBPointer to writevoid writeDouble(double value)
value
- The Double value.void writeDouble(java.lang.String name, double value)
name
- The name of the element.value
- The Double value.void writeEndArray()
void writeEndDocument()
void writeInt32(int value)
value
- The Int32 value.void writeInt32(java.lang.String name, int value)
name
- The name of the element.value
- The Int32 value.void writeInt64(long value)
value
- The Int64 value.void writeInt64(java.lang.String name, long value)
name
- The name of the element.value
- The Int64 value.void writeDecimal128(Decimal128 value)
value
- The Decimal128 value.void writeDecimal128(java.lang.String name, Decimal128 value)
name
- The name of the element.value
- The Decimal128 value.void writeJavaScript(java.lang.String code)
code
- The JavaScript code.void writeJavaScript(java.lang.String name, java.lang.String code)
name
- The name of the element.code
- The JavaScript code.void writeJavaScriptWithScope(java.lang.String code)
code
- The JavaScript code.void writeJavaScriptWithScope(java.lang.String name, java.lang.String code)
name
- The name of the element.code
- The JavaScript code.void writeMaxKey()
void writeMaxKey(java.lang.String name)
name
- The name of the element.void writeMinKey()
void writeMinKey(java.lang.String name)
name
- The name of the element.void writeName(java.lang.String name)
name
- The name of the element.void writeNull()
void writeNull(java.lang.String name)
name
- The name of the element.void writeObjectId(ObjectId objectId)
objectId
- The ObjectId value.void writeObjectId(java.lang.String name, ObjectId objectId)
name
- The name of the element.objectId
- The ObjectId value.void writeRegularExpression(BsonRegularExpression regularExpression)
regularExpression
- the regular expression to write.void writeRegularExpression(java.lang.String name, BsonRegularExpression regularExpression)
name
- The name of the element.regularExpression
- The RegularExpression value.void writeStartArray()
BsonSerializationException
- if maximum serialization depth exceeded.void writeStartArray(java.lang.String name)
name
- The name of the element.void writeStartDocument()
BsonSerializationException
- if maximum serialization depth exceeded.void writeStartDocument(java.lang.String name)
name
- The name of the element.void writeString(java.lang.String value)
value
- The String value.void writeString(java.lang.String name, java.lang.String value)
name
- The name of the element.value
- The String value.void writeSymbol(java.lang.String value)
value
- The symbol.void writeSymbol(java.lang.String name, java.lang.String value)
name
- The name of the element.value
- The symbol.void writeTimestamp(BsonTimestamp value)
value
- The combined timestamp/increment value.void writeTimestamp(java.lang.String name, BsonTimestamp value)
name
- The name of the element.value
- The combined timestamp/increment value.void writeUndefined()
void writeUndefined(java.lang.String name)
name
- The name of the element.void pipe(BsonReader reader)
reader
- The source.