Package org.bson

Class BsonBinaryWriter

All Implemented Interfaces:
Closeable, AutoCloseable, BsonWriter

@Deprecated(since="2022-10-31") public class BsonBinaryWriter extends AbstractBsonWriter
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
A BsonWriter implementation that writes to a binary stream of data. This is the most commonly used implementation.
Since:
3.0
  • Constructor Details

    • BsonBinaryWriter

      public BsonBinaryWriter(BsonOutput bsonOutput, FieldNameValidator validator)
      Deprecated.
      Construct an instance.
      Parameters:
      bsonOutput - the output to write to
      validator - the field name validator to apply
    • BsonBinaryWriter

      public BsonBinaryWriter(BsonOutput bsonOutput)
      Deprecated.
      Construct an instance.
      Parameters:
      bsonOutput - the output to write to
    • BsonBinaryWriter

      public BsonBinaryWriter(BsonWriterSettings settings, BsonBinaryWriterSettings binaryWriterSettings, BsonOutput bsonOutput)
      Deprecated.
      Construct an instance.
      Parameters:
      settings - the generic BsonWriter settings
      binaryWriterSettings - the settings specific to a BsonBinaryWriter
      bsonOutput - the output to write to
    • BsonBinaryWriter

      public BsonBinaryWriter(BsonWriterSettings settings, BsonBinaryWriterSettings binaryWriterSettings, BsonOutput bsonOutput, FieldNameValidator validator)
      Deprecated.
      Construct an instance.
      Parameters:
      settings - the generic BsonWriter settings
      binaryWriterSettings - the settings specific to a BsonBinaryWriter
      bsonOutput - the output to write to
      validator - the field name validator to apply
  • Method Details

    • close

      public void close()
      Deprecated.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractBsonWriter
    • getBsonOutput

      public BsonOutput getBsonOutput()
      Deprecated.
      Gets the BSON output backing this instance.
      Returns:
      the BSON output
    • getBinaryWriterSettings

      public BsonBinaryWriterSettings getBinaryWriterSettings()
      Deprecated.
      Returns:
      the BsonBinaryWriterSettings
      Since:
      3.6
    • flush

      public void flush()
      Deprecated.
      Description copied from interface: BsonWriter
      Flushes any pending data to the output destination.
    • doWriteBoolean

      public void doWriteBoolean(boolean value)
      Deprecated.
    • doWriteNull

      public void doWriteNull()
      Deprecated.
    • doWriteObjectId

      public void doWriteObjectId(ObjectId value)
      Deprecated.
    • doWriteRegularExpression

      public void doWriteRegularExpression(BsonRegularExpression value)
      Deprecated.
    • doWriteString

      public void doWriteString(String value)
      Deprecated.
    • doWriteSymbol

      public void doWriteSymbol(String value)
      Deprecated.
    • doWriteTimestamp

      public void doWriteTimestamp(BsonTimestamp value)
      Deprecated.
    • doWriteUndefined

      public void doWriteUndefined()
      Deprecated.
    • pipe

      public void pipe(BsonReader reader)
      Deprecated.
      Description copied from interface: BsonWriter
      Reads a single document from a BsonReader and writes it to this.
      Specified by:
      pipe in interface BsonWriter
      Overrides:
      pipe in class AbstractBsonWriter
      Parameters:
      reader - The source.
    • pipe

      public void pipe(BsonReader reader, List<BsonElement> extraElements)
      Deprecated.
      Description copied from class: AbstractBsonWriter
      Reads a single document from the given BsonReader and writes it to this, appending the given extra elements to the document.
      Overrides:
      pipe in class AbstractBsonWriter
      Parameters:
      reader - the source of the document
      extraElements - the extra elements to append to the document
    • pushMaxDocumentSize

      public void pushMaxDocumentSize(int maxDocumentSize)
      Deprecated.
      Sets a maximum size for documents from this point.
      Parameters:
      maxDocumentSize - the maximum document size.
    • popMaxDocumentSize

      public void popMaxDocumentSize()
      Deprecated.
      Reset the maximum document size to its previous value.
    • mark

      public void mark()
      Deprecated.
      Create a snapshot of this writer's context at a point in time.
    • reset

      public void reset()
      Deprecated.
      Resets this writer to the last mark() saved.
      Throws:
      IllegalStateException - if mark() was not called prior to reset.