final class com.google.protobuf.ByteBufferWriter
minor version: 0
major version: 59
flags: flags: (0x0030) ACC_FINAL, ACC_SUPER
this_class: com.google.protobuf.ByteBufferWriter
super_class: java.lang.Object
{
private static final int MIN_CACHED_BUFFER_SIZE;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 1024
private static final int MAX_CACHED_BUFFER_SIZE;
descriptor: I
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 16384
private static final float BUFFER_REALLOCATION_THRESHOLD;
descriptor: F
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: 0.5
private static final java.lang.ThreadLocal<java.lang.ref.SoftReference<byte[]>> BUFFER;
descriptor: Ljava/lang/ThreadLocal;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Signature: Ljava/lang/ThreadLocal<Ljava/lang/ref/SoftReference<[B>;>;
private static final java.lang.Class<?> FILE_OUTPUT_STREAM_CLASS;
descriptor: Ljava/lang/Class;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
Signature: Ljava/lang/Class<*>;
private static final long CHANNEL_FIELD_OFFSET;
descriptor: J
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: new java.lang.ThreadLocal
dup
invokespecial java.lang.ThreadLocal.<init>:()V
1: putstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
2: ldc "java.io.FileOutputStream"
invokestatic com.google.protobuf.ByteBufferWriter.safeGetClass:(Ljava/lang/String;)Ljava/lang/Class;
putstatic com.google.protobuf.ByteBufferWriter.FILE_OUTPUT_STREAM_CLASS:Ljava/lang/Class;
3: getstatic com.google.protobuf.ByteBufferWriter.FILE_OUTPUT_STREAM_CLASS:Ljava/lang/Class;
invokestatic com.google.protobuf.ByteBufferWriter.getChannelFieldOffset:(Ljava/lang/Class;)J
putstatic com.google.protobuf.ByteBufferWriter.CHANNEL_FIELD_OFFSET:J
return
LocalVariableTable:
Start End Slot Name Signature
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
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/google/protobuf/ByteBufferWriter;
static void clearCachedBuffer();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
aconst_null
invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
1: return
LocalVariableTable:
Start End Slot Name Signature
static void write(java.nio.ByteBuffer, java.io.OutputStream);
descriptor: (Ljava/nio/ByteBuffer;Ljava/io/OutputStream;)V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=6, args_size=2
start local 0 start local 1 0: aload 0
invokevirtual java.nio.ByteBuffer.position:()I
istore 2
start local 2 1: aload 0
invokevirtual java.nio.ByteBuffer.hasArray:()Z
ifeq 4
2: aload 1
aload 0
invokevirtual java.nio.ByteBuffer.array:()[B
aload 0
invokevirtual java.nio.ByteBuffer.arrayOffset:()I
aload 0
invokevirtual java.nio.ByteBuffer.position:()I
iadd
aload 0
invokevirtual java.nio.ByteBuffer.remaining:()I
invokevirtual java.io.OutputStream.write:([BII)V
3: goto 15
StackMap locals: int
StackMap stack:
4: aload 0
aload 1
invokestatic com.google.protobuf.ByteBufferWriter.writeToChannel:(Ljava/nio/ByteBuffer;Ljava/io/OutputStream;)Z
ifne 15
5: aload 0
invokevirtual java.nio.ByteBuffer.remaining:()I
invokestatic com.google.protobuf.ByteBufferWriter.getOrCreateBuffer:(I)[B
astore 3
start local 3 6: goto 10
7: StackMap locals: byte[]
StackMap stack:
aload 0
invokevirtual java.nio.ByteBuffer.remaining:()I
aload 3
arraylength
invokestatic java.lang.Math.min:(II)I
istore 4
start local 4 8: aload 0
aload 3
iconst_0
iload 4
invokevirtual java.nio.ByteBuffer.get:([BII)Ljava/nio/ByteBuffer;
pop
9: aload 1
aload 3
iconst_0
iload 4
invokevirtual java.io.OutputStream.write:([BII)V
end local 4 10: StackMap locals:
StackMap stack:
aload 0
invokevirtual java.nio.ByteBuffer.hasRemaining:()Z
ifne 7
end local 3 11: goto 15
StackMap locals: java.nio.ByteBuffer java.io.OutputStream int
StackMap stack: java.lang.Throwable
12: astore 5
13: aload 0
iload 2
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
pop
14: aload 5
athrow
15: StackMap locals:
StackMap stack:
aload 0
iload 2
invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
pop
16: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 17 0 buffer Ljava/nio/ByteBuffer;
0 17 1 output Ljava/io/OutputStream;
1 17 2 initialPos I
6 11 3 array [B
8 10 4 length I
Exception table:
from to target type
1 12 12 any
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
buffer
output
private static byte[] getOrCreateBuffer(int);
descriptor: (I)[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: iload 0
sipush 1024
invokestatic java.lang.Math.max:(II)I
istore 0
1: invokestatic com.google.protobuf.ByteBufferWriter.getBuffer:()[B
astore 1
start local 1 2: aload 1
ifnull 3
iload 0
aload 1
arraylength
invokestatic com.google.protobuf.ByteBufferWriter.needToReallocate:(II)Z
ifeq 6
3: StackMap locals: byte[]
StackMap stack:
iload 0
newarray 8
astore 1
4: iload 0
sipush 16384
if_icmpgt 6
5: aload 1
invokestatic com.google.protobuf.ByteBufferWriter.setBuffer:([B)V
6: StackMap locals:
StackMap stack:
aload 1
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 requestedSize I
2 7 1 buffer [B
MethodParameters:
Name Flags
requestedSize
private static boolean needToReallocate(int, int);
descriptor: (II)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: iload 1
iload 0
if_icmpge 3
1: iload 1
i2f
iload 0
i2f
ldc 0.5
fmul
2: fcmpg
ifge 3
iconst_1
ireturn
StackMap locals:
StackMap stack:
3: iconst_0
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 requestedSize I
0 4 1 bufferLength I
MethodParameters:
Name Flags
requestedSize
bufferLength
private static byte[] getBuffer();
descriptor: ()[B
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=1, locals=1, args_size=0
0: getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
invokevirtual java.lang.ThreadLocal.get:()Ljava/lang/Object;
checkcast java.lang.ref.SoftReference
astore 0
start local 0 1: aload 0
ifnonnull 2
aconst_null
goto 3
StackMap locals: java.lang.ref.SoftReference
StackMap stack:
2: aload 0
invokevirtual java.lang.ref.SoftReference.get:()Ljava/lang/Object;
checkcast byte[]
StackMap locals:
StackMap stack: byte[]
3: areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
1 4 0 sr Ljava/lang/ref/SoftReference<[B>;
private static void setBuffer(byte[]);
descriptor: ([B)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
new java.lang.ref.SoftReference
dup
aload 0
invokespecial java.lang.ref.SoftReference.<init>:(Ljava/lang/Object;)V
invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 value [B
MethodParameters:
Name Flags
value
private static boolean writeToChannel(java.nio.ByteBuffer, java.io.OutputStream);
descriptor: (Ljava/nio/ByteBuffer;Ljava/io/OutputStream;)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: getstatic com.google.protobuf.ByteBufferWriter.CHANNEL_FIELD_OFFSET:J
lconst_0
lcmp
iflt 8
getstatic com.google.protobuf.ByteBufferWriter.FILE_OUTPUT_STREAM_CLASS:Ljava/lang/Class;
aload 1
invokevirtual java.lang.Class.isInstance:(Ljava/lang/Object;)Z
ifeq 8
1: aconst_null
astore 2
start local 2 2: aload 1
getstatic com.google.protobuf.ByteBufferWriter.CHANNEL_FIELD_OFFSET:J
invokestatic com.google.protobuf.UnsafeUtil.getObject:(Ljava/lang/Object;J)Ljava/lang/Object;
checkcast java.nio.channels.WritableByteChannel
astore 2
3: goto 5
StackMap locals: java.nio.ByteBuffer java.io.OutputStream java.nio.channels.WritableByteChannel
StackMap stack: java.lang.ClassCastException
4: pop
5: StackMap locals:
StackMap stack:
aload 2
ifnull 8
6: aload 2
aload 0
invokeinterface java.nio.channels.WritableByteChannel.write:(Ljava/nio/ByteBuffer;)I
pop
7: iconst_1
ireturn
end local 2 8: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 buffer Ljava/nio/ByteBuffer;
0 9 1 output Ljava/io/OutputStream;
2 8 2 channel Ljava/nio/channels/WritableByteChannel;
Exception table:
from to target type
2 3 4 Class java.lang.ClassCastException
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
buffer
output
private static java.lang.Class<?> safeGetClass(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/Class;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokestatic java.lang.Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
1: areturn
2: StackMap locals:
StackMap stack: java.lang.ClassNotFoundException
pop
3: aconst_null
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 className Ljava/lang/String;
Exception table:
from to target type
0 1 2 Class java.lang.ClassNotFoundException
Signature: (Ljava/lang/String;)Ljava/lang/Class<*>;
MethodParameters:
Name Flags
className
private static long getChannelFieldOffset(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)J
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
ifnull 5
invokestatic com.google.protobuf.UnsafeUtil.hasUnsafeArrayOperations:()Z
ifeq 5
1: aload 0
ldc "channel"
invokevirtual java.lang.Class.getDeclaredField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
astore 1
start local 1 2: aload 1
invokestatic com.google.protobuf.UnsafeUtil.objectFieldOffset:(Ljava/lang/reflect/Field;)J
3: lreturn
end local 1 4: StackMap locals:
StackMap stack: java.lang.Throwable
pop
5: StackMap locals:
StackMap stack:
ldc -1
lreturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 clazz Ljava/lang/Class<*>;
2 4 1 field Ljava/lang/reflect/Field;
Exception table:
from to target type
0 3 4 Class java.lang.Throwable
Signature: (Ljava/lang/Class<*>;)J
MethodParameters:
Name Flags
clazz
}
SourceFile: "ByteBufferWriter.java"