public class org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream extends java.io.OutputStream
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream
super_class: java.io.OutputStream
{
static final int DEFAULT_SIZE;
descriptor: I
flags: (0x0018) ACC_STATIC, ACC_FINAL
ConstantValue: 1024
private static final byte[] EMPTY_BYTE_ARRAY;
descriptor: [B
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private final java.util.List<byte[]> buffers;
descriptor: Ljava/util/List;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/List<[B>;
private int currentBufferIndex;
descriptor: I
flags: (0x0002) ACC_PRIVATE
private int filledBufferSum;
descriptor: I
flags: (0x0002) ACC_PRIVATE
private byte[] currentBuffer;
descriptor: [B
flags: (0x0002) ACC_PRIVATE
private int count;
descriptor: I
flags: (0x0002) ACC_PRIVATE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: iconst_0
newarray 8
putstatic org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.EMPTY_BYTE_ARRAY:[B
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
sipush 1024
invokespecial org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.<init>:(I)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
public void <init>(int);
descriptor: (I)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: aload 0
invokespecial java.io.OutputStream.<init>:()V
1: aload 0
new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
2: iload 1
ifge 6
3: new java.lang.IllegalArgumentException
dup
4: new java.lang.StringBuilder
dup
ldc "Negative initial size: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
iload 1
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
5: invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream int
StackMap stack:
aload 0
dup
astore 2
monitorenter
7: aload 0
iload 1
invokevirtual org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.needNewBuffer:(I)V
8: aload 2
monitorexit
9: goto 12
StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream int org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream
StackMap stack: java.lang.Throwable
10: aload 2
monitorexit
11: athrow
12: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 13 1 size I
Exception table:
from to target type
7 9 10 any
10 11 10 any
MethodParameters:
Name Flags
size final
private void needNewBuffer(int);
descriptor: (I)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
invokeinterface java.util.List.size:()I
iconst_1
isub
if_icmpge 5
1: aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
2: aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
iconst_1
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
3: aload 0
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
invokeinterface java.util.List.get:(I)Ljava/lang/Object;
checkcast byte[]
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
4: goto 16
5: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
ifnonnull 9
6: iload 1
istore 2
start local 2 7: aload 0
iconst_0
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
8: goto 13
end local 2 9: StackMap locals:
StackMap stack:
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iconst_1
ishl
10: iload 1
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
isub
11: invokestatic java.lang.Math.max:(II)I
istore 2
start local 2 12: aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
13: StackMap locals: int
StackMap stack:
aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
iconst_1
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBufferIndex:I
14: aload 0
iload 2
newarray 8
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
15: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 2 16: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 17 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 17 1 newcount I
7 9 2 newBufferSize I
12 16 2 newBufferSize I
MethodParameters:
Name Flags
newcount final
public void write(byte[], int, int);
descriptor: ([BII)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=5, locals=9, args_size=4
start local 0 start local 1 start local 2 start local 3 0: iload 2
iflt 5
1: iload 2
aload 1
arraylength
if_icmpgt 5
2: iload 3
iflt 5
3: iload 2
iload 3
iadd
aload 1
arraylength
if_icmpgt 5
4: iload 2
iload 3
iadd
ifge 6
5: StackMap locals:
StackMap stack:
new java.lang.IndexOutOfBoundsException
dup
invokespecial java.lang.IndexOutOfBoundsException.<init>:()V
athrow
6: StackMap locals:
StackMap stack:
iload 3
ifne 8
7: return
8: StackMap locals:
StackMap stack:
aload 0
dup
astore 4
monitorenter
9: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
iload 3
iadd
istore 5
start local 5 10: iload 3
istore 6
start local 6 11: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
isub
istore 7
start local 7 12: goto 19
13: StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream byte[] int int org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream int int int
StackMap stack:
iload 6
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iload 7
isub
invokestatic java.lang.Math.min:(II)I
istore 8
start local 8 14: aload 1
iload 2
iload 3
iadd
iload 6
isub
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
iload 7
iload 8
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
15: iload 6
iload 8
isub
istore 6
16: iload 6
ifle 19
17: aload 0
iload 5
invokevirtual org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.needNewBuffer:(I)V
18: iconst_0
istore 7
end local 8 19: StackMap locals:
StackMap stack:
iload 6
ifgt 13
20: aload 0
iload 5
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
end local 7 end local 6 end local 5 21: aload 4
monitorexit
22: goto 25
StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream byte[] int int org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream
StackMap stack: java.lang.Throwable
23: aload 4
monitorexit
24: athrow
25: StackMap locals:
StackMap stack:
return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 26 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 26 1 b [B
0 26 2 off I
0 26 3 len I
10 21 5 newcount I
11 21 6 remaining I
12 21 7 inBufferPos I
14 19 8 part I
Exception table:
from to target type
9 22 23 any
23 24 23 any
MethodParameters:
Name Flags
b final
off final
len final
public synchronized void write(int);
descriptor: (I)V
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
isub
istore 2
start local 2 1: iload 2
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
if_icmpne 4
2: aload 0
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
iconst_1
iadd
invokevirtual org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.needNewBuffer:(I)V
3: iconst_0
istore 2
4: StackMap locals: int
StackMap stack:
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
iload 2
iload 1
i2b
bastore
5: aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
iconst_1
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
6: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 7 1 b I
1 7 2 inBufferPos I
MethodParameters:
Name Flags
b final
public synchronized int write(java.io.InputStream);
descriptor: (Ljava/io/InputStream;)I
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=5, locals=5, args_size=2
start local 0 start local 1 0: iconst_0
istore 2
start local 2 1: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.filledBufferSum:I
isub
istore 3
start local 3 2: aload 1
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
iload 3
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iload 3
isub
invokevirtual java.io.InputStream.read:([BII)I
istore 4
start local 4 3: goto 11
4: StackMap locals: int int int
StackMap stack:
iload 2
iload 4
iadd
istore 2
5: iload 3
iload 4
iadd
istore 3
6: aload 0
dup
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
iload 4
iadd
putfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
7: iload 3
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
if_icmpne 10
8: aload 0
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
invokevirtual org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.needNewBuffer:(I)V
9: iconst_0
istore 3
10: StackMap locals:
StackMap stack:
aload 1
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
iload 3
aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.currentBuffer:[B
arraylength
iload 3
isub
invokevirtual java.io.InputStream.read:([BII)I
istore 4
11: StackMap locals:
StackMap stack:
iload 4
iconst_m1
if_icmpne 4
12: iload 2
ireturn
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 13 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 13 1 in Ljava/io/InputStream;
1 13 2 readCount I
2 13 3 inBufferPos I
3 13 4 n I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in final
public void close();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=0, locals=1, args_size=1
start local 0 0: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
Exceptions:
throws java.io.IOException
public synchronized void writeTo(java.io.OutputStream);
descriptor: (Ljava/io/OutputStream;)V
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=4, locals=6, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
istore 2
start local 2 1: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 4
goto 8
StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream java.io.OutputStream int top java.util.Iterator
StackMap stack:
2: aload 4
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast byte[]
astore 3
start local 3 3: aload 3
arraylength
iload 2
invokestatic java.lang.Math.min:(II)I
istore 5
start local 5 4: aload 1
aload 3
iconst_0
iload 5
invokevirtual java.io.OutputStream.write:([BII)V
5: iload 2
iload 5
isub
istore 2
6: iload 2
ifne 8
7: goto 9
end local 5 end local 3 8: StackMap locals:
StackMap stack:
aload 4
invokeinterface java.util.Iterator.hasNext:()Z
ifne 2
9: StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream java.io.OutputStream int
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
0 10 1 out Ljava/io/OutputStream;
1 10 2 remaining I
3 8 3 buf [B
4 8 5 c I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
out final
public synchronized byte[] toByteArray();
descriptor: ()[B
flags: (0x0021) ACC_PUBLIC, ACC_SYNCHRONIZED
Code:
stack=5, locals=7, args_size=1
start local 0 0: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.count:I
istore 1
start local 1 1: iload 1
ifne 3
2: getstatic org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.EMPTY_BYTE_ARRAY:[B
areturn
3: StackMap locals: int
StackMap stack:
iload 1
newarray 8
astore 2
start local 2 4: iconst_0
istore 3
start local 3 5: aload 0
getfield org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream.buffers:Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 5
goto 13
StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream int byte[] int top java.util.Iterator
StackMap stack:
6: aload 5
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast byte[]
astore 4
start local 4 7: aload 4
arraylength
iload 1
invokestatic java.lang.Math.min:(II)I
istore 6
start local 6 8: aload 4
iconst_0
aload 2
iload 3
iload 6
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
9: iload 3
iload 6
iadd
istore 3
10: iload 1
iload 6
isub
istore 1
11: iload 1
ifne 13
12: goto 14
end local 6 end local 4 13: StackMap locals:
StackMap stack:
aload 5
invokeinterface java.util.Iterator.hasNext:()Z
ifne 6
14: StackMap locals: org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream int byte[] int
StackMap stack:
aload 2
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 this Lorg/apache/tomcat/util/http/fileupload/ByteArrayOutputStream;
1 15 1 remaining I
4 15 2 newbuf [B
5 15 3 pos I
7 13 4 buf [B
8 13 6 c I
}
SourceFile: "ByteArrayOutputStream.java"