public class com.mongodb.internal.connection.tlschannel.impl.BufferHolder
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: com.mongodb.internal.connection.tlschannel.impl.BufferHolder
super_class: java.lang.Object
{
private static final com.mongodb.diagnostics.logging.Logger LOGGER;
descriptor: Lcom/mongodb/diagnostics/logging/Logger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final byte[] ZEROS;
descriptor: [B
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
public final java.lang.String name;
descriptor: Ljava/lang/String;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
public final com.mongodb.internal.connection.tlschannel.BufferAllocator allocator;
descriptor: Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
public final boolean plainData;
descriptor: Z
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
public final int maxSize;
descriptor: I
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
public final boolean opportunisticDispose;
descriptor: Z
flags: (0x0011) ACC_PUBLIC, ACC_FINAL
private org.bson.ByteBuf byteBuf;
descriptor: Lorg/bson/ByteBuf;
flags: (0x0002) ACC_PRIVATE
public java.nio.ByteBuffer buffer;
descriptor: Ljava/nio/ByteBuffer;
flags: (0x0001) ACC_PUBLIC
public int lastSize;
descriptor: I
flags: (0x0001) ACC_PUBLIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc "connection.tls"
invokestatic com.mongodb.diagnostics.logging.Loggers.getLogger:(Ljava/lang/String;)Lcom/mongodb/diagnostics/logging/Logger;
putstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
1: sipush 17408
invokestatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.roundUpToNextHighestPowerOfTwo:(I)I
newarray 8
putstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.ZEROS:[B
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>(java.lang.String, com.mongodb.internal.connection.tlschannel.BufferAllocator, int, int, boolean, boolean);
descriptor: (Ljava/lang/String;Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;IIZZ)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=7, 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 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
aload 1
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.name:Ljava/lang/String;
2: aload 0
aload 2
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.allocator:Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
3: aload 0
aconst_null
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
4: aload 0
iload 4
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.maxSize:I
5: aload 0
iload 5
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.plainData:Z
6: aload 0
iload 6
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.opportunisticDispose:Z
7: aload 0
iload 3
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.lastSize:I
8: 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 9 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
0 9 1 name Ljava/lang/String;
0 9 2 allocator Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
0 9 3 initialSize I
0 9 4 maxSize I
0 9 5 plainData Z
0 9 6 opportunisticDispose Z
MethodParameters:
Name Flags
name final
allocator final
initialSize final
maxSize final
plainData final
opportunisticDispose final
public void prepare();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
ifnonnull 3
1: aload 0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.allocator:Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.lastSize:I
invokeinterface com.mongodb.internal.connection.tlschannel.BufferAllocator.allocate:(I)Lorg/bson/ByteBuf;
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.byteBuf:Lorg/bson/ByteBuf;
2: aload 0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.byteBuf:Lorg/bson/ByteBuf;
invokeinterface org.bson.ByteBuf.asNIO:()Ljava/nio/ByteBuffer;
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
3: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
public boolean release();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.opportunisticDispose:Z
ifeq 2
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.position:()I
ifne 2
1: aload 0
invokevirtual com.mongodb.internal.connection.tlschannel.impl.BufferHolder.dispose:()Z
ireturn
2: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
public boolean dispose();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
ifnull 4
1: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.allocator:Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.byteBuf:Lorg/bson/ByteBuf;
invokeinterface com.mongodb.internal.connection.tlschannel.BufferAllocator.free:(Lorg/bson/ByteBuf;)V
2: aload 0
aconst_null
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
3: iconst_1
ireturn
4: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
public void resize(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=2, args_size=2
start local 0 start local 1 0: iload 1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.maxSize:I
if_icmple 2
1: new java.lang.IllegalArgumentException
dup
ldc "new capacity (%s) bigger than absolute max size (%s)"
iconst_2
anewarray java.lang.Object
dup
iconst_0
iload 1
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.maxSize:I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 4
3: getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "resizing buffer %s, increasing from %s to %s (manual sizing)"
iconst_3
anewarray java.lang.Object
dup
iconst_0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.name:Ljava/lang/String;
aastore
dup
iconst_1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.capacity:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
iload 1
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
4: StackMap locals:
StackMap stack:
aload 0
iload 1
invokevirtual com.mongodb.internal.connection.tlschannel.impl.BufferHolder.resizeImpl:(I)V
5: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
0 6 1 newCapacity I
MethodParameters:
Name Flags
newCapacity final
public void enlarge();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=2, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.capacity:()I
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.maxSize:I
if_icmplt 4
1: new java.lang.IllegalStateException
dup
2: ldc "%s buffer insufficient despite having capacity of %d"
iconst_2
anewarray java.lang.Object
dup
iconst_0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.name:Ljava/lang/String;
aastore
dup
iconst_1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.capacity:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
3: invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.lastSize:I
iconst_2
imul
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.maxSize:I
invokestatic java.lang.Math.min:(II)I
istore 1
start local 1 5: getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
invokeinterface com.mongodb.diagnostics.logging.Logger.isTraceEnabled:()Z
ifeq 7
6: getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.LOGGER:Lcom/mongodb/diagnostics/logging/Logger;
ldc "enlarging buffer %s, increasing from %s to %s (automatic enlarge)"
iconst_3
anewarray java.lang.Object
dup
iconst_0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.name:Ljava/lang/String;
aastore
dup
iconst_1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.capacity:()I
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
dup
iconst_2
iload 1
invokestatic java.lang.Integer.valueOf:(I)Ljava/lang/Integer;
aastore
invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokeinterface com.mongodb.diagnostics.logging.Logger.trace:(Ljava/lang/String;)V
7: StackMap locals: int
StackMap stack:
aload 0
iload 1
invokevirtual com.mongodb.internal.connection.tlschannel.impl.BufferHolder.resizeImpl:(I)V
8: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
5 9 1 newCapacity I
private void resizeImpl(int);
descriptor: (I)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=4, args_size=2
start local 0 start local 1 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.allocator:Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
iload 1
invokeinterface com.mongodb.internal.connection.tlschannel.BufferAllocator.allocate:(I)Lorg/bson/ByteBuf;
astore 2
start local 2 1: aload 2
invokeinterface org.bson.ByteBuf.asNIO:()Ljava/nio/ByteBuffer;
astore 3
start local 3 2: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.flip:()Ljava/nio/Buffer;
pop
3: aload 3
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.put:(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
pop
4: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.plainData:Z
ifeq 6
5: aload 0
invokevirtual com.mongodb.internal.connection.tlschannel.impl.BufferHolder.zero:()V
6: StackMap locals: org.bson.ByteBuf java.nio.ByteBuffer
StackMap stack:
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.allocator:Lcom/mongodb/internal/connection/tlschannel/BufferAllocator;
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.byteBuf:Lorg/bson/ByteBuf;
invokeinterface com.mongodb.internal.connection.tlschannel.BufferAllocator.free:(Lorg/bson/ByteBuf;)V
7: aload 0
aload 2
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.byteBuf:Lorg/bson/ByteBuf;
8: aload 0
aload 3
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
9: aload 0
iload 1
putfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.lastSize:I
10: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
0 11 1 newCapacity I
1 11 2 newByteBuf Lorg/bson/ByteBuf;
2 11 3 newBuffer Ljava/nio/ByteBuffer;
MethodParameters:
Name Flags
newCapacity final
public void zeroRemaining();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.mark:()Ljava/nio/Buffer;
pop
1: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.ZEROS:[B
iconst_0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.remaining:()I
invokevirtual java.nio.ByteBuffer.put:([BII)Ljava/nio/ByteBuffer;
pop
2: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.reset:()Ljava/nio/Buffer;
pop
3: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
public void zero();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.mark:()Ljava/nio/Buffer;
pop
1: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
iconst_0
invokevirtual java.nio.Buffer.position:(I)Ljava/nio/Buffer;
pop
2: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
getstatic com.mongodb.internal.connection.tlschannel.impl.BufferHolder.ZEROS:[B
iconst_0
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.remaining:()I
invokevirtual java.nio.ByteBuffer.put:([BII)Ljava/nio/ByteBuffer;
pop
3: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.Buffer.reset:()Ljava/nio/Buffer;
pop
4: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
public boolean nullOrEmpty();
descriptor: ()Z
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
ifnull 1
aload 0
getfield com.mongodb.internal.connection.tlschannel.impl.BufferHolder.buffer:Ljava/nio/ByteBuffer;
invokevirtual java.nio.ByteBuffer.position:()I
ifeq 1
iconst_0
ireturn
StackMap locals:
StackMap stack:
1: iconst_1
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lcom/mongodb/internal/connection/tlschannel/impl/BufferHolder;
private static int roundUpToNextHighestPowerOfTwo(int);
descriptor: (I)I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: iload 0
istore 1
start local 1 1: iinc 1 -1
2: iload 1
iload 1
iconst_1
ishr
ior
istore 1
3: iload 1
iload 1
iconst_2
ishr
ior
istore 1
4: iload 1
iload 1
iconst_4
ishr
ior
istore 1
5: iload 1
iload 1
bipush 8
ishr
ior
istore 1
6: iload 1
iload 1
bipush 16
ishr
ior
istore 1
7: iinc 1 1
8: iload 1
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 size I
1 9 1 v I
MethodParameters:
Name Flags
size final
}
SourceFile: "BufferHolder.java"