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, int);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;I)V
flags: (0x0008) ACC_STATIC
Code:
stack=6, locals=6, args_size=6
start local 0 start local 1 start local 2 start local 3 start local 4 start local 5 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
iload 5
invokestatic com.mongodb.internal.connection.BsonWriterHelper.writePayload:(Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;I)V
2: aload 0
invokeinterface org.bson.BsonWriter.writeEndArray:()V
3: 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 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;
0 4 5 maxSplittableDocumentSize I
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
messageStartPosition final
payload final
maxSplittableDocumentSize final
static void writePayload(org.bson.BsonWriter, org.bson.io.BsonOutput, com.mongodb.internal.connection.MessageSettings, int, com.mongodb.connection.SplittablePayload, int);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;ILcom/mongodb/connection/SplittablePayload;I)V
flags: (0x0008) ACC_STATIC
Code:
stack=7, locals=8, args_size=6
start local 0 start local 1 start local 2 start local 3 start local 4 start local 5 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 6
start local 6 1: iconst_0
istore 7
start local 7 2: goto 9
3: StackMap locals: com.mongodb.internal.connection.MessageSettings int
StackMap stack:
aload 0
aload 1
aload 6
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayload:()Ljava/util/List;
iload 7
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast org.bson.BsonDocument
iload 3
iload 7
iconst_1
iadd
4: iload 5
5: invokestatic com.mongodb.internal.connection.BsonWriterHelper.writeDocument:(Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;Lorg/bson/BsonDocument;III)Z
6: ifeq 10
7: aload 4
iload 7
iconst_1
iadd
invokevirtual com.mongodb.connection.SplittablePayload.setPosition:(I)V
8: iinc 7 1
StackMap locals:
StackMap stack:
9: iload 7
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPayload:()Ljava/util/List;
invokeinterface java.util.List.size:()I
if_icmplt 3
end local 7 10: StackMap locals:
StackMap stack:
aload 4
invokevirtual com.mongodb.connection.SplittablePayload.getPosition:()I
ifne 14
11: new org.bson.BsonMaximumSizeExceededException
dup
ldc "Payload document size is larger than maximum of %d."
iconst_1
anewarray java.lang.Object
dup
iconst_0
12: aload 6
invokevirtual com.mongodb.internal.connection.MessageSettings.getMaxDocumentSize:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
13: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial org.bson.BsonMaximumSizeExceededException.<init>:(Ljava/lang/String;)V
athrow
14: StackMap locals:
StackMap stack:
return
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 15 0 writer Lorg/bson/BsonWriter;
0 15 1 bsonOutput Lorg/bson/io/BsonOutput;
0 15 2 settings Lcom/mongodb/internal/connection/MessageSettings;
0 15 3 messageStartPosition I
0 15 4 payload Lcom/mongodb/connection/SplittablePayload;
0 15 5 maxSplittableDocumentSize I
1 15 6 payloadSettings Lcom/mongodb/internal/connection/MessageSettings;
2 10 7 i I
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
messageStartPosition final
payload final
maxSplittableDocumentSize final
private static boolean writeDocument(org.bson.BsonWriter, org.bson.io.BsonOutput, com.mongodb.internal.connection.MessageSettings, org.bson.BsonDocument, int, int, int);
descriptor: (Lorg/bson/BsonWriter;Lorg/bson/io/BsonOutput;Lcom/mongodb/internal/connection/MessageSettings;Lorg/bson/BsonDocument;III)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=10, args_size=7
start local 0 start local 1 start local 2 start local 3 start local 4 start local 5 start local 6 0: aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
istore 7
start local 7 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 8
start local 8 3: aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
iload 7
isub
istore 9
start local 9 4: aload 2
iload 8
iload 9
iload 5
invokestatic com.mongodb.internal.connection.BsonWriterHelper.exceedsLimits:(Lcom/mongodb/internal/connection/MessageSettings;III)Z
ifne 6
5: iload 5
iconst_1
if_icmple 8
aload 1
invokeinterface org.bson.io.BsonOutput.getPosition:()I
iload 4
isub
iload 6
if_icmple 8
6: StackMap locals: int int int
StackMap stack:
aload 1
iload 7
invokeinterface org.bson.io.BsonOutput.truncateToPosition:(I)V
7: iconst_0
ireturn
8: StackMap locals:
StackMap stack:
iconst_1
ireturn
end local 9 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 9 0 writer Lorg/bson/BsonWriter;
0 9 1 bsonOutput Lorg/bson/io/BsonOutput;
0 9 2 settings Lcom/mongodb/internal/connection/MessageSettings;
0 9 3 document Lorg/bson/BsonDocument;
0 9 4 messageStartPosition I
0 9 5 batchItemCount I
0 9 6 maxSplittableDocumentSize I
1 9 7 currentPosition I
3 9 8 messageSize I
4 9 9 documentSize I
MethodParameters:
Name Flags
writer final
bsonOutput final
settings final
document final
messageStartPosition final
batchItemCount final
maxSplittableDocumentSize 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