Package org.bson
Interface BSONEncoder
-
- All Known Implementing Classes:
BasicBSONEncoder,DefaultDBEncoder
@Deprecated(since="2022-10-31") public interface BSONEncoderDeprecated.Usage of this API is not supported in AEM as a Cloud Service.A
BSONEncoderis a class which can be used to turn documents into byte arrays. TheBSONEncoderwalks down through the object graph and writes correspondingbytesequences into underlyingOutputBuffer.This class is a part of legacy API. Please check
Encoderfor a new one.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddone()Deprecated.Free the resources.byte[]encode(BSONObject document)Deprecated.Encode a document into byte array.intputObject(BSONObject document)Deprecated.Encoder and write a document into underlying buffer.voidset(OutputBuffer buffer)Deprecated.Sets the buffer to wrich the result of encoding will be written.
-
-
-
Method Detail
-
encode
byte[] encode(BSONObject document)
Deprecated.Encode a document into byte array. This is a shortcut method which creates a newOutputBuffer, invokes the other 3 methods in a corresponding sequence: and returns the contents of theOutputBuffer.- Parameters:
document- the document to be encoded- Returns:
- a byte sequence
-
putObject
int putObject(BSONObject document)
Deprecated.Encoder and write a document into underlying buffer.- Parameters:
document- the document to be encoded- Returns:
- number of bytes written
-
done
void done()
Deprecated.Free the resources.
-
set
void set(OutputBuffer buffer)
Deprecated.Sets the buffer to wrich the result of encoding will be written.- Parameters:
buffer- the buffer to be used to write a byte sequences to
-
-