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: .line 72
            new java.lang.ThreadLocal
            dup
            invokespecial java.lang.ThreadLocal.<init>:()V
         1: .line 71
            putstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
         2: .line 75
            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: .line 77
            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 // com.google.protobuf.ByteBufferWriter this
         0: .line 45
            aload 0 /* this */
            invokespecial java.lang.Object.<init>:()V
            return
        end local 0 // com.google.protobuf.ByteBufferWriter this
      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: .line 84
            getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
            aconst_null
            invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
         1: .line 85
            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 // java.nio.ByteBuffer buffer
        start local 1 // java.io.OutputStream output
         0: .line 92
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.position:()I
            istore 2 /* initialPos */
        start local 2 // int initialPos
         1: .line 94
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.hasArray:()Z
            ifeq 4
         2: .line 97
            aload 1 /* output */
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.array:()[B
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.arrayOffset:()I
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.position:()I
            iadd
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.remaining:()I
            invokevirtual java.io.OutputStream.write:([BII)V
         3: .line 98
            goto 15
      StackMap locals: int
      StackMap stack:
         4: aload 0 /* buffer */
            aload 1 /* output */
            invokestatic com.google.protobuf.ByteBufferWriter.writeToChannel:(Ljava/nio/ByteBuffer;Ljava/io/OutputStream;)Z
            ifne 15
         5: .line 101
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.remaining:()I
            invokestatic com.google.protobuf.ByteBufferWriter.getOrCreateBuffer:(I)[B
            astore 3 /* array */
        start local 3 // byte[] array
         6: .line 102
            goto 10
         7: .line 103
      StackMap locals: byte[]
      StackMap stack:
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.remaining:()I
            aload 3 /* array */
            arraylength
            invokestatic java.lang.Math.min:(II)I
            istore 4 /* length */
        start local 4 // int length
         8: .line 104
            aload 0 /* buffer */
            aload 3 /* array */
            iconst_0
            iload 4 /* length */
            invokevirtual java.nio.ByteBuffer.get:([BII)Ljava/nio/ByteBuffer;
            pop
         9: .line 105
            aload 1 /* output */
            aload 3 /* array */
            iconst_0
            iload 4 /* length */
            invokevirtual java.io.OutputStream.write:([BII)V
        end local 4 // int length
        10: .line 102
      StackMap locals:
      StackMap stack:
            aload 0 /* buffer */
            invokevirtual java.nio.ByteBuffer.hasRemaining:()Z
            ifne 7
        end local 3 // byte[] array
        11: .line 108
            goto 15
      StackMap locals: java.nio.ByteBuffer java.io.OutputStream int
      StackMap stack: java.lang.Throwable
        12: astore 5
        13: .line 110
            aload 0 /* buffer */
            iload 2 /* initialPos */
            invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
            pop
        14: .line 111
            aload 5
            athrow
        15: .line 110
      StackMap locals:
      StackMap stack:
            aload 0 /* buffer */
            iload 2 /* initialPos */
            invokevirtual java.nio.ByteBuffer.position:(I)Ljava/nio/Buffer;
            pop
        16: .line 112
            return
        end local 2 // int initialPos
        end local 1 // java.io.OutputStream output
        end local 0 // java.nio.ByteBuffer buffer
      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 // int requestedSize
         0: .line 115
            iload 0 /* requestedSize */
            sipush 1024
            invokestatic java.lang.Math.max:(II)I
            istore 0 /* requestedSize */
         1: .line 117
            invokestatic com.google.protobuf.ByteBufferWriter.getBuffer:()[B
            astore 1 /* buffer */
        start local 1 // byte[] buffer
         2: .line 119
            aload 1 /* buffer */
            ifnull 3
            iload 0 /* requestedSize */
            aload 1 /* buffer */
            arraylength
            invokestatic com.google.protobuf.ByteBufferWriter.needToReallocate:(II)Z
            ifeq 6
         3: .line 120
      StackMap locals: byte[]
      StackMap stack:
            iload 0 /* requestedSize */
            newarray 8
            astore 1 /* buffer */
         4: .line 123
            iload 0 /* requestedSize */
            sipush 16384
            if_icmpgt 6
         5: .line 124
            aload 1 /* buffer */
            invokestatic com.google.protobuf.ByteBufferWriter.setBuffer:([B)V
         6: .line 127
      StackMap locals:
      StackMap stack:
            aload 1 /* buffer */
            areturn
        end local 1 // byte[] buffer
        end local 0 // int requestedSize
      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 // int requestedSize
        start local 1 // int bufferLength
         0: .line 132
            iload 1 /* bufferLength */
            iload 0 /* requestedSize */
            if_icmpge 3
         1: .line 133
            iload 1 /* bufferLength */
            i2f
            iload 0 /* requestedSize */
            i2f
            ldc 0.5
            fmul
         2: .line 132
            fcmpg
            ifge 3
            iconst_1
            ireturn
      StackMap locals:
      StackMap stack:
         3: iconst_0
            ireturn
        end local 1 // int bufferLength
        end local 0 // int requestedSize
      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: .line 137
            getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
            invokevirtual java.lang.ThreadLocal.get:()Ljava/lang/Object;
            checkcast java.lang.ref.SoftReference
            astore 0 /* sr */
        start local 0 // java.lang.ref.SoftReference sr
         1: .line 138
            aload 0 /* sr */
            ifnonnull 2
            aconst_null
            goto 3
      StackMap locals: java.lang.ref.SoftReference
      StackMap stack:
         2: aload 0 /* sr */
            invokevirtual java.lang.ref.SoftReference.get:()Ljava/lang/Object;
            checkcast byte[]
      StackMap locals:
      StackMap stack: byte[]
         3: areturn
        end local 0 // java.lang.ref.SoftReference sr
      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 // byte[] value
         0: .line 142
            getstatic com.google.protobuf.ByteBufferWriter.BUFFER:Ljava/lang/ThreadLocal;
            new java.lang.ref.SoftReference
            dup
            aload 0 /* value */
            invokespecial java.lang.ref.SoftReference.<init>:(Ljava/lang/Object;)V
            invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
         1: .line 143
            return
        end local 0 // byte[] value
      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 // java.nio.ByteBuffer buffer
        start local 1 // java.io.OutputStream output
         0: .line 146
            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 /* output */
            invokevirtual java.lang.Class.isInstance:(Ljava/lang/Object;)Z
            ifeq 8
         1: .line 148
            aconst_null
            astore 2 /* channel */
        start local 2 // java.nio.channels.WritableByteChannel channel
         2: .line 150
            aload 1 /* output */
            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 /* channel */
         3: .line 151
            goto 5
      StackMap locals: java.nio.ByteBuffer java.io.OutputStream java.nio.channels.WritableByteChannel
      StackMap stack: java.lang.ClassCastException
         4: pop
         5: .line 154
      StackMap locals:
      StackMap stack:
            aload 2 /* channel */
            ifnull 8
         6: .line 155
            aload 2 /* channel */
            aload 0 /* buffer */
            invokeinterface java.nio.channels.WritableByteChannel.write:(Ljava/nio/ByteBuffer;)I
            pop
         7: .line 156
            iconst_1
            ireturn
        end local 2 // java.nio.channels.WritableByteChannel channel
         8: .line 159
      StackMap locals:
      StackMap stack:
            iconst_0
            ireturn
        end local 1 // java.io.OutputStream output
        end local 0 // java.nio.ByteBuffer buffer
      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 // java.lang.String className
         0: .line 164
            aload 0 /* className */
            invokestatic java.lang.Class.forName:(Ljava/lang/String;)Ljava/lang/Class;
         1: areturn
         2: .line 165
      StackMap locals:
      StackMap stack: java.lang.ClassNotFoundException
            pop
         3: .line 166
            aconst_null
            areturn
        end local 0 // java.lang.String className
      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 // java.lang.Class clazz
         0: .line 172
            aload 0 /* clazz */
            ifnull 5
            invokestatic com.google.protobuf.UnsafeUtil.hasUnsafeArrayOperations:()Z
            ifeq 5
         1: .line 173
            aload 0 /* clazz */
            ldc "channel"
            invokevirtual java.lang.Class.getDeclaredField:(Ljava/lang/String;)Ljava/lang/reflect/Field;
            astore 1 /* field */
        start local 1 // java.lang.reflect.Field field
         2: .line 174
            aload 1 /* field */
            invokestatic com.google.protobuf.UnsafeUtil.objectFieldOffset:(Ljava/lang/reflect/Field;)J
         3: lreturn
        end local 1 // java.lang.reflect.Field field
         4: .line 176
      StackMap locals:
      StackMap stack: java.lang.Throwable
            pop
         5: .line 179
      StackMap locals:
      StackMap stack:
            ldc -1
            lreturn
        end local 0 // java.lang.Class clazz
      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"