final class com.mongodb.internal.connection.BsonWriterHelper
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: com.mongodb.internal.connection.BsonWriterHelper
super_class: java.lang.Object
{
private static final int DOCUMENT_HEADROOM;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 16384
private static final org.bson.codecs.configuration.CodecRegistry REGISTRY;
descriptor: Lorg/bson/codecs/configuration/CodecRegistry;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final org.bson.codecs.EncoderContext ENCODER_CONTEXT;
descriptor: Lorg/bson/codecs/EncoderContext;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=5, locals=0, args_size=0
0: iconst_1
anewarray org.bson.codecs.configuration.CodecProvider
dup
iconst_0
new org.bson.codecs.BsonValueCodecProvider
dup
invokespecial org.bson.codecs.BsonValueCodecProvider.<init>:()V
aastore
invokestatic org.bson.codecs.configuration.CodecRegistries.fromProviders:([Lorg/bson/codecs/configuration/CodecProvider;)Lorg/bson/codecs/configuration/CodecRegistry;
putstatic com.mongodb.internal.connection.BsonWriterHelper.REGISTRY:Lorg/bson/codecs/configuration/CodecRegistry;
1: invokestatic org.bson.codecs.EncoderContext.builder:()Lorg/bson/codecs/EncoderContext$Builder;
invokevirtual org.bson.codecs.EncoderContext$Builder.build:()Lorg/bson/codecs/EncoderContext;
putstatic com.mongodb.internal.connection.BsonWriterHelper.ENCODER_CONTEXT:Lorg/bson/codecs/EncoderContext;
return
LocalVariableTable:
Start End Slot Name Signature
static void writeElements(org.bson.BsonWriter, java.util.List<org.bson.BsonElement>);
descriptor: (Lorg/bson/BsonWriter;Ljava/util/List;)V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=4, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 3
goto 4
StackMap locals: org.bson.BsonWriter java.util.List top java.util.Iterator
StackMap stack:
1: aload 3
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast org.bson.BsonElement
astore 2
start local 2 2: aload 0
aload 2
invokevirtual org.bson.BsonElement.getName:()Ljava/lang/String;
invokeinterface org.bson.BsonWriter.writeName:(Ljava/lang/String;)V
3: aload 2
invokevirtual org.bson.BsonElement.getValue:()Lorg/bson/BsonValue;
invokestatic com.mongodb.internal.connection.BsonWriterHelper.getCodec:(Lorg/bson/BsonValue;)Lorg/bson/codecs/Codec;
aload 0
aload 2
invokevirtual org.bson.BsonElement.getValue:()Lorg/bson/BsonValue;
getstatic com.mongodb.internal.connection.BsonWriterHelper.ENCODER_CONTEXT:Lorg/bson/codecs/EncoderContext;
invokeinterface org.bson.codecs.Codec.encode:(Lorg/bson/BsonWriter;Ljava/lang/Object;Lorg/bson/codecs/EncoderContext;)V
end local 2 4: StackMap locals:
StackMap stack:
aload 3
invokeinterface java.util.Iterator.hasNext:()Z
ifne 1
5: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 writer Lorg/bson/BsonWriter;
0 6 1 bsonElements Ljava/util/List<Lorg/bson/BsonElement;>;
2 4 2 bsonElement Lorg/bson/BsonElement;
Signature: (Lorg/bson/BsonWriter;Ljava/util/List<Lorg/bson/BsonElement;>;)V
MethodParameters:
Name Flags
writer final
bsonElements final
static void writePayloadArray(org.bson.BsonWriter, org.bson.io.BsonOutput, com.mongodb.internal.connection.MessageSettings, int, com.mongodb.connection.SplittablePayload);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;)V
flags: (0x0008) ACC_STATIC
Code:
stack=5, locals=5, args_size=5
start local 0 start local 1 start local 2 start local 3 start local 4 0: aload 0
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayloadName:()Ljava/lang/String;
invokeinterface org.bson.BsonWriter.writeStartArray:(Ljava/lang/String;)V
1: aload 0
aload 1
aload 2
invokestatic com.mongodb.internal.connection.BsonWriterHelper.getDocumentMessageSettings:(Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings;
iload 3
aload 4
invokestatic com.mongodb.internal.connection.BsonWriterHelper.writePayload:(Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;)V
2: aload 0
invokeinterface org.bson.BsonWriter.writeEndArray:()V
3: return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 writer Lorg/bson/BsonWriter;
0 4 1 bsonOutput Lorg/bson/io/BsonOutput;
0 4 2 settings Lcom/mongodb/internal/connection/MessageSettings;
0 4 3 messageStartPosition I
0 4 4 payload Lcom/mongodb/connection/SplittablePayload;
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
messageStartPosition final
payload final
static void writePayload(org.bson.BsonWriter, org.bson.io.BsonOutput, com.mongodb.internal.connection.MessageSettings, int, com.mongodb.connection.SplittablePayload);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;)V
flags: (0x0008) ACC_STATIC
Code:
stack=7, locals=7, args_size=5
start local 0 start local 1 start local 2 start local 3 start local 4 0: aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayloadType:()Lcom/mongodb/connection/SplittablePayload$Type;
aload 2
invokestatic com.mongodb.internal.connection.BsonWriterHelper.getPayloadMessageSettings:(Lcom/mongodb/connection/SplittablePayload$Type;Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings;
astore 5
start local 5 1: iconst_0
istore 6
start local 6 2: goto 6
3: StackMap locals: com.mongodb.internal.connection.MessageSettings int
StackMap stack:
aload 0
aload 1
aload 5
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayload:()Ljava/util/List;
iload 6
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast org.bson.BsonDocument
iload 3
iload 6
iconst_1
iadd
invokestatic com.mongodb.internal.connection.BsonWriterHelper.writeDocument:(Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;Lorg/bson/BsonDocument;II)Z
ifeq 7
4: aload 4
iload 6
iconst_1
iadd
invokevirtual com.mongodb.connection.SplittablePayload.setPosition:(I)V
5: iinc 6 1
StackMap locals:
StackMap stack:
6: iload 6
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayload:()Ljava/util/List;
invokeinterface java.util.List.size:()I
if_icmplt 3
end local 6 7: StackMap locals:
StackMap stack:
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPosition:()I
ifne 11
8: new org.bson.BsonMaximumSizeExceededException
dup
ldc "Payload document size is larger than maximum of %d."
iconst_1
anewarray java.lang.Object
dup
iconst_0
9: aload 5
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
10: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial org.bson.BsonMaximumSizeExceededException.<init>:(Ljava/lang/String;)V
athrow
11: StackMap locals:
StackMap stack:
return
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 writer Lorg/bson/BsonWriter;
0 12 1 bsonOutput Lorg/bson/io/BsonOutput;
0 12 2 settings Lcom/mongodb/internal/connection/MessageSettings;
0 12 3 messageStartPosition I
0 12 4 payload Lcom/mongodb/connection/SplittablePayload;
1 12 5 payloadSettings Lcom/mongodb/internal/connection/MessageSettings;
2 7 6 i I
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
messageStartPosition final
payload final
private static boolean writeDocument(org.bson.BsonWriter, org.bson.io.BsonOutput, com.mongodb.internal.connection.MessageSettings, org.bson.BsonDocument, int, int);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;Lorg/bson/BsonDocument;II)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=9, args_size=6
start local 0 start local 1 start local 2 start local 3 start local 4 start local 5 0: aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
istore 6
start local 6 1: aload 3
invokestatic com.mongodb.internal.connection.BsonWriterHelper.getCodec:(Lorg/bson/BsonValue;)Lorg/bson/codecs/Codec;
aload 0
aload 3
getstatic com.mongodb.internal.connection.BsonWriterHelper.ENCODER_CONTEXT:Lorg/bson/codecs/EncoderContext;
invokeinterface org.bson.codecs.Codec.encode:(Lorg/bson/BsonWriter;Ljava/lang/Object;Lorg/bson/codecs/EncoderContext;)V
2: aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
iload 4
isub
istore 7
start local 7 3: aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
iload 6
isub
istore 8
start local 8 4: aload 2
iload 7
iload 8
iload 5
invokestatic com.mongodb.internal.connection.BsonWriterHelper.exceedsLimits:(Lcom/mongodb/internal/connection/MessageSettings;III)Z
ifeq 7
5: aload 1
iload 6
invokeinterface org.bson.io.BsonOutput.truncateToPosition:(I)V
6: iconst_0
ireturn
7: StackMap locals: int int int
StackMap stack:
iconst_1
ireturn
end local 8 end local 7 end local 6 end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 writer Lorg/bson/BsonWriter;
0 8 1 bsonOutput Lorg/bson/io/BsonOutput;
0 8 2 settings Lcom/mongodb/internal/connection/MessageSettings;
0 8 3 document Lorg/bson/BsonDocument;
0 8 4 messageStartPosition I
0 8 5 batchItemCount I
1 8 6 currentPosition I
3 8 7 messageSize I
4 8 8 documentSize I
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
document final
messageStartPosition final
batchItemCount final
private static org.bson.codecs.Codec<org.bson.BsonValue> getCodec(org.bson.BsonValue);
descriptor: (Lorg/bson/BsonValue;)Lorg/bson/codecs/Codec;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: getstatic com.mongodb.internal.connection.BsonWriterHelper.REGISTRY:Lorg/bson/codecs/configuration/CodecRegistry;
aload 0
invokevirtual java.lang.Object.getClass:()Ljava/lang/Class;
invokeinterface org.bson.codecs.configuration.CodecRegistry.get:(Ljava/lang/Class;)Lorg/bson/codecs/Codec;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 bsonValue Lorg/bson/BsonValue;
Signature: (Lorg/bson/BsonValue;)Lorg/bson/codecs/Codec<Lorg/bson/BsonValue;>;
MethodParameters:
Name Flags
bsonValue final
private static com.mongodb.internal.connection.MessageSettings getPayloadMessageSettings(com.mongodb.connection.SplittablePayload$Type, com.mongodb.internal.connection.MessageSettings);
descriptor: (Lcom/mongodb/connection/SplittablePayload$Type;Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 1
astore 2
start local 2 1: aload 0
getstatic com.mongodb.connection.SplittablePayload$Type.INSERT:Lcom/mongodb/connection/SplittablePayload$Type;
if_acmpeq 6
2: aload 1
invokestatic com.mongodb.internal.connection.BsonWriterHelper.createMessageSettingsBuilder:(Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings$Builder;
3: aload 1
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
sipush 16384
iadd
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxDocumentSize:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
4: invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.build:()Lcom/mongodb/internal/connection/MessageSettings;
5: astore 2
6: StackMap locals: com.mongodb.internal.connection.MessageSettings
StackMap stack:
aload 2
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 type Lcom/mongodb/connection/SplittablePayload$Type;
0 7 1 settings Lcom/mongodb/internal/connection/MessageSettings;
1 7 2 payloadMessageSettings Lcom/mongodb/internal/connection/MessageSettings;
MethodParameters:
Name Flags
type final
settings final
private static com.mongodb.internal.connection.MessageSettings getDocumentMessageSettings(com.mongodb.internal.connection.MessageSettings);
descriptor: (Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
invokestatic com.mongodb.internal.connection.BsonWriterHelper.createMessageSettingsBuilder:(Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings$Builder;
1: aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
sipush 16384
iadd
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxMessageSize:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
2: invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.build:()Lcom/mongodb/internal/connection/MessageSettings;
3: areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 settings Lcom/mongodb/internal/connection/MessageSettings;
MethodParameters:
Name Flags
settings final
private static com.mongodb.internal.connection.MessageSettings$Builder createMessageSettingsBuilder(com.mongodb.internal.connection.MessageSettings);
descriptor: (Lcom/mongodb/internal/connection/MessageSettings;)Lcom/mongodb/internal/connection/MessageSettings$Builder;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: invokestatic com.mongodb.internal.connection.MessageSettings.builder:()Lcom/mongodb/internal/connection/MessageSettings$Builder;
1: aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxBatchCount:()I
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxBatchCount:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
2: aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxMessageSize:()I
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxMessageSize:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
3: aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxDocumentSize:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
4: aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxWireVersion:()I
invokevirtual com.mongodb.internal.connection.MessageSettings$Builder.maxWireVersion:(I)Lcom/mongodb/internal/connection/MessageSettings$Builder;
5: areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 settings Lcom/mongodb/internal/connection/MessageSettings;
MethodParameters:
Name Flags
settings final
private static boolean exceedsLimits(com.mongodb.internal.connection.MessageSettings, int, int, int);
descriptor: (Lcom/mongodb/internal/connection/MessageSettings;III)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=4, args_size=4
start local 0 start local 1 start local 2 start local 3 0: iload 3
aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxBatchCount:()I
if_icmple 2
1: iconst_1
ireturn
2: StackMap locals:
StackMap stack:
iload 1
aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxMessageSize:()I
if_icmple 4
3: iconst_1
ireturn
4: StackMap locals:
StackMap stack:
iload 2
aload 0
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
if_icmple 6
5: iconst_1
ireturn
6: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 settings Lcom/mongodb/internal/connection/MessageSettings;
0 7 1 messageSize I
0 7 2 documentSize I
0 7 3 batchItemCount I
MethodParameters:
Name Flags
settings final
messageSize final
documentSize final
batchItemCount final
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/BsonWriterHelper;
}
SourceFile: "BsonWriterHelper.java"
InnerClasses:
public final Type = com.mongodb.connection.SplittablePayload$Type of com.mongodb.connection.SplittablePayload
public final Builder = com.mongodb.internal.connection.MessageSettings$Builder of com.mongodb.internal.connection.MessageSettings
public final Builder = org.bson.codecs.EncoderContext$Builder of org.bson.codecs.EncoderContext