public class BsonBinaryWriter extends AbstractBsonWriter
AbstractBsonWriter.State
Constructor and Description |
---|
BsonBinaryWriter(BsonOutput bsonOutput)
Construct an instance.
|
BsonBinaryWriter(BsonOutput bsonOutput,
FieldNameValidator validator)
Construct an instance.
|
BsonBinaryWriter(BsonWriterSettings settings,
BsonBinaryWriterSettings binaryWriterSettings,
BsonOutput bsonOutput)
Construct an instance.
|
BsonBinaryWriter(BsonWriterSettings settings,
BsonBinaryWriterSettings binaryWriterSettings,
BsonOutput bsonOutput,
FieldNameValidator validator)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
doWriteBoolean(boolean value)
Handles the logic of writing a boolean value
|
void |
doWriteNull()
Handles the logic of writing a Null value
|
void |
doWriteObjectId(ObjectId value)
Handles the logic of writing an ObjectId
|
void |
doWriteRegularExpression(BsonRegularExpression value)
Handles the logic of writing a regular expression
|
void |
doWriteString(java.lang.String value)
Handles the logic of writing a String
|
void |
doWriteSymbol(java.lang.String value)
Handles the logic of writing a Symbol
|
void |
doWriteTimestamp(BsonTimestamp value)
Handles the logic of writing a timestamp
|
void |
doWriteUndefined()
Handles the logic of writing an Undefined value
|
void |
flush()
Flushes any pending data to the output destination.
|
BsonBinaryWriterSettings |
getBinaryWriterSettings() |
BsonOutput |
getBsonOutput()
Gets the BSON output backing this instance.
|
void |
mark()
Create a snapshot of this writer's context at a point in time.
|
void |
pipe(BsonReader reader)
Reads a single document from a BsonReader and writes it to this.
|
void |
pipe(BsonReader reader,
java.util.List<BsonElement> extraElements)
Reads a single document from the given BsonReader and writes it to this, appending the given extra elements to the document.
|
void |
popMaxDocumentSize()
Reset the maximum document size to its previous value.
|
void |
pushMaxDocumentSize(int maxDocumentSize)
Sets a maximum size for documents from this point.
|
void |
reset()
Resets this writer to the last
mark() saved. |
writeBinaryData, writeBinaryData, writeBoolean, writeBoolean, writeDateTime, writeDateTime, writeDBPointer, writeDBPointer, writeDecimal128, writeDecimal128, writeDouble, writeDouble, writeEndArray, writeEndDocument, writeInt32, writeInt32, writeInt64, writeInt64, writeJavaScript, writeJavaScript, writeJavaScriptWithScope, writeJavaScriptWithScope, writeMaxKey, writeMaxKey, writeMinKey, writeMinKey, writeName, writeNull, writeNull, writeObjectId, writeObjectId, writeRegularExpression, writeRegularExpression, writeStartArray, writeStartArray, writeStartDocument, writeStartDocument, writeString, writeString, writeSymbol, writeSymbol, writeTimestamp, writeTimestamp, writeUndefined, writeUndefined
public BsonBinaryWriter(BsonOutput bsonOutput, FieldNameValidator validator)
bsonOutput
- the output to write tovalidator
- the field name validator to applypublic BsonBinaryWriter(BsonOutput bsonOutput)
bsonOutput
- the output to write topublic BsonBinaryWriter(BsonWriterSettings settings, BsonBinaryWriterSettings binaryWriterSettings, BsonOutput bsonOutput)
settings
- the generic BsonWriter settingsbinaryWriterSettings
- the settings specific to a BsonBinaryWriterbsonOutput
- the output to write topublic BsonBinaryWriter(BsonWriterSettings settings, BsonBinaryWriterSettings binaryWriterSettings, BsonOutput bsonOutput, FieldNameValidator validator)
settings
- the generic BsonWriter settingsbinaryWriterSettings
- the settings specific to a BsonBinaryWriterbsonOutput
- the output to write tovalidator
- the field name validator to applypublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractBsonWriter
public BsonOutput getBsonOutput()
public BsonBinaryWriterSettings getBinaryWriterSettings()
public void flush()
BsonWriter
public void doWriteBoolean(boolean value)
AbstractBsonWriter
value
- the boolean
value to writepublic void doWriteNull()
AbstractBsonWriter
public void doWriteObjectId(ObjectId value)
AbstractBsonWriter
value
- the ObjectId
value to writepublic void doWriteRegularExpression(BsonRegularExpression value)
AbstractBsonWriter
value
- the BsonRegularExpression
value to writepublic void doWriteString(java.lang.String value)
AbstractBsonWriter
value
- the String
value to writepublic void doWriteSymbol(java.lang.String value)
AbstractBsonWriter
value
- the boolean
value to writepublic void doWriteTimestamp(BsonTimestamp value)
AbstractBsonWriter
value
- the BsonTimestamp
value to writepublic void doWriteUndefined()
AbstractBsonWriter
public void pipe(BsonReader reader)
BsonWriter
pipe
in interface BsonWriter
pipe
in class AbstractBsonWriter
reader
- The source.public void pipe(BsonReader reader, java.util.List<BsonElement> extraElements)
AbstractBsonWriter
pipe
in class AbstractBsonWriter
reader
- the source of the documentextraElements
- the extra elements to append to the documentpublic void pushMaxDocumentSize(int maxDocumentSize)
maxDocumentSize
- the maximum document size.public void popMaxDocumentSize()
public void mark()
Copyright © 2010 - 2020 Adobe. All Rights Reserved