public abstract class org.springframework.util.StreamUtils
minor version: 0
major version: 59
flags: flags: (0x0421) ACC_PUBLIC, ACC_SUPER, ACC_ABSTRACT
this_class: org.springframework.util.StreamUtils
super_class: java.lang.Object
{
public static final int BUFFER_SIZE;
descriptor: I
flags: (0x0019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL
ConstantValue: 4096
private static final byte[] EMPTY_CONTENT;
descriptor: [B
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: iconst_0
newarray 8
putstatic org.springframework.util.StreamUtils.EMPTY_CONTENT:[B
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
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 Lorg/springframework/util/StreamUtils;
public static byte[] copyToByteArray(java.io.InputStream);
descriptor: (Ljava/io/InputStream;)[B
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
ifnonnull 2
1: iconst_0
newarray 8
areturn
2: StackMap locals:
StackMap stack:
new java.io.ByteArrayOutputStream
dup
sipush 4096
invokespecial java.io.ByteArrayOutputStream.<init>:(I)V
astore 1
start local 1 3: aload 0
aload 1
invokestatic org.springframework.util.StreamUtils.copy:(Ljava/io/InputStream;Ljava/io/OutputStream;)I
pop
4: aload 1
invokevirtual java.io.ByteArrayOutputStream.toByteArray:()[B
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 in Ljava/io/InputStream;
3 5 1 out Ljava/io/ByteArrayOutputStream;
Exceptions:
throws java.io.IOException
RuntimeVisibleParameterAnnotations:
0:
org.springframework.lang.Nullable()
MethodParameters:
Name Flags
in
public static java.lang.String copyToString(java.io.InputStream, java.nio.charset.Charset);
descriptor: (Ljava/io/InputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=6, args_size=2
start local 0 start local 1 0: aload 0
ifnonnull 2
1: ldc ""
areturn
2: StackMap locals:
StackMap stack:
new java.lang.StringBuilder
dup
sipush 4096
invokespecial java.lang.StringBuilder.<init>:(I)V
astore 2
start local 2 3: new java.io.InputStreamReader
dup
aload 0
aload 1
invokespecial java.io.InputStreamReader.<init>:(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
astore 3
start local 3 4: sipush 4096
newarray 5
astore 4
start local 4 5: goto 7
start local 5 6: StackMap locals: java.io.InputStream java.nio.charset.Charset java.lang.StringBuilder java.io.InputStreamReader char[] int
StackMap stack:
aload 2
aload 4
iconst_0
iload 5
invokevirtual java.lang.StringBuilder.append:([CII)Ljava/lang/StringBuilder;
pop
end local 5 7: StackMap locals:
StackMap stack:
aload 3
aload 4
invokevirtual java.io.InputStreamReader.read:([C)I
dup
istore 5
start local 5 8: iconst_m1
if_icmpne 6
9: aload 2
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
areturn
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 10 0 in Ljava/io/InputStream;
0 10 1 charset Ljava/nio/charset/Charset;
3 10 2 out Ljava/lang/StringBuilder;
4 10 3 reader Ljava/io/InputStreamReader;
5 10 4 buffer [C
6 7 5 charsRead I
8 10 5 charsRead I
Exceptions:
throws java.io.IOException
RuntimeVisibleParameterAnnotations:
0:
org.springframework.lang.Nullable()
1:
MethodParameters:
Name Flags
in
charset
public static java.lang.String copyToString(java.io.ByteArrayOutputStream, java.nio.charset.Charset);
descriptor: (Ljava/io/ByteArrayOutputStream;Ljava/nio/charset/Charset;)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=3, args_size=2
start local 0 start local 1 0: aload 0
ldc "No ByteArrayOutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: aload 1
ldc "No Charset specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
2: aload 0
aload 1
invokevirtual java.nio.charset.Charset.name:()Ljava/lang/String;
invokevirtual java.io.ByteArrayOutputStream.toString:(Ljava/lang/String;)Ljava/lang/String;
3: areturn
4: StackMap locals:
StackMap stack: java.io.UnsupportedEncodingException
astore 2
start local 2 5: new java.lang.IllegalArgumentException
dup
new java.lang.StringBuilder
dup
ldc "Invalid charset name: "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 2
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 baos Ljava/io/ByteArrayOutputStream;
0 6 1 charset Ljava/nio/charset/Charset;
5 6 2 ex Ljava/io/UnsupportedEncodingException;
Exception table:
from to target type
2 3 4 Class java.io.UnsupportedEncodingException
MethodParameters:
Name Flags
baos
charset
public static void copy(byte[], java.io.OutputStream);
descriptor: ([BLjava/io/OutputStream;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
ldc "No input byte array specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: aload 1
ldc "No OutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
2: aload 1
aload 0
invokevirtual java.io.OutputStream.write:([B)V
3: aload 1
invokevirtual java.io.OutputStream.flush:()V
4: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 in [B
0 5 1 out Ljava/io/OutputStream;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in
out
public static void copy(java.lang.String, java.nio.charset.Charset, java.io.OutputStream);
descriptor: (Ljava/lang/String;Ljava/nio/charset/Charset;Ljava/io/OutputStream;)V
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
ldc "No input String specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: aload 1
ldc "No Charset specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
2: aload 2
ldc "No OutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
3: new java.io.OutputStreamWriter
dup
aload 2
aload 1
invokespecial java.io.OutputStreamWriter.<init>:(Ljava/io/OutputStream;Ljava/nio/charset/Charset;)V
astore 3
start local 3 4: aload 3
aload 0
invokevirtual java.io.Writer.write:(Ljava/lang/String;)V
5: aload 3
invokevirtual java.io.Writer.flush:()V
6: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 in Ljava/lang/String;
0 7 1 charset Ljava/nio/charset/Charset;
0 7 2 out Ljava/io/OutputStream;
4 7 3 writer Ljava/io/Writer;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in
charset
out
public static int copy(java.io.InputStream, java.io.OutputStream);
descriptor: (Ljava/io/InputStream;Ljava/io/OutputStream;)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=4, locals=5, args_size=2
start local 0 start local 1 0: aload 0
ldc "No InputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: aload 1
ldc "No OutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
2: iconst_0
istore 2
start local 2 3: sipush 4096
newarray 8
astore 3
start local 3 4: goto 7
start local 4 5: StackMap locals: int byte[] int
StackMap stack:
aload 1
aload 3
iconst_0
iload 4
invokevirtual java.io.OutputStream.write:([BII)V
6: iload 2
iload 4
iadd
istore 2
end local 4 7: StackMap locals:
StackMap stack:
aload 0
aload 3
invokevirtual java.io.InputStream.read:([B)I
dup
istore 4
start local 4 8: iconst_m1
if_icmpne 5
9: aload 1
invokevirtual java.io.OutputStream.flush:()V
10: 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 11 0 in Ljava/io/InputStream;
0 11 1 out Ljava/io/OutputStream;
3 11 2 byteCount I
4 11 3 buffer [B
5 7 4 bytesRead I
8 11 4 bytesRead I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in
out
public static long copyRange(java.io.InputStream, java.io.OutputStream, long, long);
descriptor: (Ljava/io/InputStream;Ljava/io/OutputStream;JJ)J
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=12, args_size=4
start local 0 start local 1 start local 2 start local 4 0: aload 0
ldc "No InputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: aload 1
ldc "No OutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
2: aload 0
lload 2
invokevirtual java.io.InputStream.skip:(J)J
lstore 6
start local 6 3: lload 6
lload 2
lcmp
ifge 5
4: new java.io.IOException
dup
new java.lang.StringBuilder
dup
ldc "Skipped only "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
lload 6
invokevirtual java.lang.StringBuilder.append:(J)Ljava/lang/StringBuilder;
ldc " bytes out of "
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
lload 2
invokevirtual java.lang.StringBuilder.append:(J)Ljava/lang/StringBuilder;
ldc " required"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial java.io.IOException.<init>:(Ljava/lang/String;)V
athrow
5: StackMap locals: long
StackMap stack:
lload 4
lload 2
lsub
lconst_1
ladd
lstore 8
start local 8 6: ldc 4096
lload 8
invokestatic java.lang.Math.min:(JJ)J
l2i
newarray 8
astore 10
start local 10 7: goto 17
8: StackMap locals: long byte[]
StackMap stack:
aload 0
aload 10
invokevirtual java.io.InputStream.read:([B)I
istore 11
start local 11 9: iload 11
iconst_m1
if_icmpne 11
10: goto 18
11: StackMap locals: int
StackMap stack:
iload 11
i2l
lload 8
lcmp
ifgt 15
12: aload 1
aload 10
iconst_0
iload 11
invokevirtual java.io.OutputStream.write:([BII)V
13: lload 8
iload 11
i2l
lsub
lstore 8
14: goto 17
15: StackMap locals:
StackMap stack:
aload 1
aload 10
iconst_0
lload 8
l2i
invokevirtual java.io.OutputStream.write:([BII)V
16: lconst_0
lstore 8
end local 11 17: StackMap locals:
StackMap stack:
lload 8
lconst_0
lcmp
ifgt 8
18: StackMap locals:
StackMap stack:
lload 4
lload 2
lsub
lconst_1
ladd
lload 8
lsub
lreturn
end local 10 end local 8 end local 6 end local 4 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 19 0 in Ljava/io/InputStream;
0 19 1 out Ljava/io/OutputStream;
0 19 2 start J
0 19 4 end J
3 19 6 skipped J
6 19 8 bytesToCopy J
7 19 10 buffer [B
9 17 11 bytesRead I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in
out
start
end
public static int drain(java.io.InputStream);
descriptor: (Ljava/io/InputStream;)I
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=4, args_size=1
start local 0 0: aload 0
ldc "No InputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: sipush 4096
newarray 8
astore 1
start local 1 2: iconst_m1
istore 2
start local 2 3: iconst_0
istore 3
start local 3 4: goto 6
5: StackMap locals: byte[] int int
StackMap stack:
iload 3
iload 2
iadd
istore 3
6: StackMap locals:
StackMap stack:
aload 0
aload 1
invokevirtual java.io.InputStream.read:([B)I
dup
istore 2
iconst_m1
if_icmpne 5
7: iload 3
ireturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 in Ljava/io/InputStream;
2 8 1 buffer [B
3 8 2 bytesRead I
4 8 3 byteCount I
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
in
public static java.io.InputStream emptyInput();
descriptor: ()Ljava/io/InputStream;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=0, args_size=0
0: new java.io.ByteArrayInputStream
dup
getstatic org.springframework.util.StreamUtils.EMPTY_CONTENT:[B
invokespecial java.io.ByteArrayInputStream.<init>:([B)V
areturn
LocalVariableTable:
Start End Slot Name Signature
public static java.io.InputStream nonClosing(java.io.InputStream);
descriptor: (Ljava/io/InputStream;)Ljava/io/InputStream;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ldc "No InputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: new org.springframework.util.StreamUtils$NonClosingInputStream
dup
aload 0
invokespecial org.springframework.util.StreamUtils$NonClosingInputStream.<init>:(Ljava/io/InputStream;)V
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 in Ljava/io/InputStream;
MethodParameters:
Name Flags
in
public static java.io.OutputStream nonClosing(java.io.OutputStream);
descriptor: (Ljava/io/OutputStream;)Ljava/io/OutputStream;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ldc "No OutputStream specified"
invokestatic org.springframework.util.Assert.notNull:(Ljava/lang/Object;Ljava/lang/String;)V
1: new org.springframework.util.StreamUtils$NonClosingOutputStream
dup
aload 0
invokespecial org.springframework.util.StreamUtils$NonClosingOutputStream.<init>:(Ljava/io/OutputStream;)V
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 out Ljava/io/OutputStream;
MethodParameters:
Name Flags
out
}
SourceFile: "StreamUtils.java"
NestMembers:
org.springframework.util.StreamUtils$NonClosingInputStream org.springframework.util.StreamUtils$NonClosingOutputStream
InnerClasses:
private NonClosingInputStream = org.springframework.util.StreamUtils$NonClosingInputStream of org.springframework.util.StreamUtils
private NonClosingOutputStream = org.springframework.util.StreamUtils$NonClosingOutputStream of org.springframework.util.StreamUtils