Package org.bson

Class BasicBSONEncoder

java.lang.Object
org.bson.BasicBSONEncoder
All Implemented Interfaces:
BSONEncoder
Direct Known Subclasses:
DefaultDBEncoder

@Deprecated(since="2022-10-31") public class BasicBSONEncoder extends Object implements BSONEncoder
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
This is meant to be pooled or cached. There is some per instance memory for string conversion, etc...
  • Constructor Details

    • BasicBSONEncoder

      public BasicBSONEncoder()
      Deprecated.
  • Method Details

    • encode

      public byte[] encode(BSONObject document)
      Deprecated.
      Description copied from interface: BSONEncoder
      Encode a document into byte array. This is a shortcut method which creates a new OutputBuffer, invokes the other 3 methods in a corresponding sequence: and returns the contents of the OutputBuffer.
      Specified by:
      encode in interface BSONEncoder
      Parameters:
      document - the document to be encoded
      Returns:
      a byte sequence
    • done

      public void done()
      Deprecated.
      Description copied from interface: BSONEncoder
      Free the resources.
      Specified by:
      done in interface BSONEncoder
    • set

      public void set(OutputBuffer buffer)
      Deprecated.
      Description copied from interface: BSONEncoder
      Sets the buffer to wrich the result of encoding will be written.
      Specified by:
      set in interface BSONEncoder
      Parameters:
      buffer - the buffer to be used to write a byte sequences to
    • putObject

      public int putObject(BSONObject document)
      Deprecated.
      Encodes a BSONObject. This is for the higher level api calls.
      Specified by:
      putObject in interface BSONEncoder
      Parameters:
      document - the document to encode
      Returns:
      the number of characters in the encoding