public class org.springframework.http.converter.ResourceHttpMessageConverter extends org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.core.io.Resource>
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.springframework.http.converter.ResourceHttpMessageConverter
super_class: org.springframework.http.converter.AbstractHttpMessageConverter
{
private final boolean supportsReadStreaming;
descriptor: Z
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
getstatic org.springframework.http.MediaType.ALL:Lorg/springframework/http/MediaType;
invokespecial org.springframework.http.converter.AbstractHttpMessageConverter.<init>:(Lorg/springframework/http/MediaType;)V
1: aload 0
iconst_1
putfield org.springframework.http.converter.ResourceHttpMessageConverter.supportsReadStreaming:Z
2: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
public void <init>(boolean);
descriptor: (Z)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getstatic org.springframework.http.MediaType.ALL:Lorg/springframework/http/MediaType;
invokespecial org.springframework.http.converter.AbstractHttpMessageConverter.<init>:(Lorg/springframework/http/MediaType;)V
1: aload 0
iload 1
putfield org.springframework.http.converter.ResourceHttpMessageConverter.supportsReadStreaming:Z
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 3 1 supportsReadStreaming Z
MethodParameters:
Name Flags
supportsReadStreaming
protected boolean supports(java.lang.Class<?>);
descriptor: (Ljava/lang/Class;)Z
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: ldc Lorg/springframework/core/io/Resource;
aload 1
invokevirtual java.lang.Class.isAssignableFrom:(Ljava/lang/Class;)Z
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 1 1 clazz Ljava/lang/Class<*>;
Signature: (Ljava/lang/Class<*>;)Z
MethodParameters:
Name Flags
clazz
protected org.springframework.core.io.Resource readInternal(java.lang.Class<? extends org.springframework.core.io.Resource>, org.springframework.http.HttpInputMessage);
descriptor: (Ljava/lang/Class;Lorg/springframework/http/HttpInputMessage;)Lorg/springframework/core/io/Resource;
flags: (0x0004) ACC_PROTECTED
Code:
stack=5, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield org.springframework.http.converter.ResourceHttpMessageConverter.supportsReadStreaming:Z
ifeq 2
ldc Lorg/springframework/core/io/InputStreamResource;
aload 1
if_acmpne 2
1: new org.springframework.http.converter.ResourceHttpMessageConverter$1
dup
aload 0
aload 2
invokeinterface org.springframework.http.HttpInputMessage.getBody:()Ljava/io/InputStream;
aload 2
invokespecial org.springframework.http.converter.ResourceHttpMessageConverter$1.<init>:(Lorg/springframework/http/converter/ResourceHttpMessageConverter;Ljava/io/InputStream;Lorg/springframework/http/HttpInputMessage;)V
areturn
2: StackMap locals:
StackMap stack:
ldc Lorg/springframework/core/io/Resource;
aload 1
if_acmpeq 3
ldc Lorg/springframework/core/io/ByteArrayResource;
aload 1
invokevirtual java.lang.Class.isAssignableFrom:(Ljava/lang/Class;)Z
ifeq 5
3: StackMap locals:
StackMap stack:
aload 2
invokeinterface org.springframework.http.HttpInputMessage.getBody:()Ljava/io/InputStream;
invokestatic org.springframework.util.StreamUtils.copyToByteArray:(Ljava/io/InputStream;)[B
astore 3
start local 3 4: new org.springframework.http.converter.ResourceHttpMessageConverter$2
dup
aload 0
aload 3
aload 2
invokespecial org.springframework.http.converter.ResourceHttpMessageConverter$2.<init>:(Lorg/springframework/http/converter/ResourceHttpMessageConverter;[BLorg/springframework/http/HttpInputMessage;)V
areturn
end local 3 5: StackMap locals:
StackMap stack:
new org.springframework.http.converter.HttpMessageNotReadableException
dup
new java.lang.StringBuilder
dup
ldc "Unsupported resource class: "
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 org.springframework.http.converter.HttpMessageNotReadableException.<init>:(Ljava/lang/String;Lorg/springframework/http/HttpInputMessage;)V
athrow
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 6 1 clazz Ljava/lang/Class<+Lorg/springframework/core/io/Resource;>;
0 6 2 inputMessage Lorg/springframework/http/HttpInputMessage;
4 5 3 body [B
Exceptions:
throws java.io.IOException, org.springframework.http.converter.HttpMessageNotReadableException
Signature: (Ljava/lang/Class<+Lorg/springframework/core/io/Resource;>;Lorg/springframework/http/HttpInputMessage;)Lorg/springframework/core/io/Resource;
MethodParameters:
Name Flags
clazz
inputMessage
protected org.springframework.http.MediaType getDefaultContentType(org.springframework.core.io.Resource);
descriptor: (Lorg/springframework/core/io/Resource;)Lorg/springframework/http/MediaType;
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic org.springframework.http.MediaTypeFactory.getMediaType:(Lorg/springframework/core/io/Resource;)Ljava/util/Optional;
getstatic org.springframework.http.MediaType.APPLICATION_OCTET_STREAM:Lorg/springframework/http/MediaType;
invokevirtual java.util.Optional.orElse:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast org.springframework.http.MediaType
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 1 1 resource Lorg/springframework/core/io/Resource;
MethodParameters:
Name Flags
resource
protected java.lang.Long getContentLength(org.springframework.core.io.Resource, org.springframework.http.MediaType);
descriptor: (Lorg/springframework/core/io/Resource;Lorg/springframework/http/MediaType;)Ljava/lang/Long;
flags: (0x0004) ACC_PROTECTED
Code:
stack=4, locals=5, args_size=3
start local 0 start local 1 start local 2 0: ldc Lorg/springframework/core/io/InputStreamResource;
aload 1
invokevirtual java.lang.Object.getClass:()Ljava/lang/Class;
if_acmpne 2
1: aconst_null
areturn
2: StackMap locals:
StackMap stack:
aload 1
invokeinterface org.springframework.core.io.Resource.contentLength:()J
lstore 3
start local 3 3: lload 3
lconst_0
lcmp
ifge 4
aconst_null
goto 5
StackMap locals: long
StackMap stack:
4: lload 3
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
StackMap locals:
StackMap stack: java.lang.Long
5: areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 6 1 resource Lorg/springframework/core/io/Resource;
0 6 2 contentType Lorg/springframework/http/MediaType;
3 6 3 contentLength J
Exceptions:
throws java.io.IOException
RuntimeVisibleParameterAnnotations:
0:
1:
org.springframework.lang.Nullable()
MethodParameters:
Name Flags
resource
contentType
protected void writeInternal(org.springframework.core.io.Resource, org.springframework.http.HttpOutputMessage);
descriptor: (Lorg/springframework/core/io/Resource;Lorg/springframework/http/HttpOutputMessage;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
aload 2
invokevirtual org.springframework.http.converter.ResourceHttpMessageConverter.writeContent:(Lorg/springframework/core/io/Resource;Lorg/springframework/http/HttpOutputMessage;)V
1: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 2 1 resource Lorg/springframework/core/io/Resource;
0 2 2 outputMessage Lorg/springframework/http/HttpOutputMessage;
Exceptions:
throws java.io.IOException, org.springframework.http.converter.HttpMessageNotWritableException
MethodParameters:
Name Flags
resource
outputMessage
protected void writeContent(org.springframework.core.io.Resource, org.springframework.http.HttpOutputMessage);
descriptor: (Lorg/springframework/core/io/Resource;Lorg/springframework/http/HttpOutputMessage;)V
flags: (0x0004) ACC_PROTECTED
Code:
stack=2, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokeinterface org.springframework.core.io.Resource.getInputStream:()Ljava/io/InputStream;
astore 3
start local 3 1: aload 3
aload 2
invokeinterface org.springframework.http.HttpOutputMessage.getBody:()Ljava/io/OutputStream;
invokestatic org.springframework.util.StreamUtils.copy:(Ljava/io/InputStream;Ljava/io/OutputStream;)I
pop
2: goto 12
3: StackMap locals: org.springframework.http.converter.ResourceHttpMessageConverter org.springframework.core.io.Resource org.springframework.http.HttpOutputMessage java.io.InputStream
StackMap stack: java.lang.NullPointerException
pop
4: aload 3
invokevirtual java.io.InputStream.close:()V
5: goto 17
6: StackMap locals:
StackMap stack: java.lang.Throwable
pop
goto 17
7: StackMap locals:
StackMap stack: java.lang.Throwable
astore 4
8: aload 3
invokevirtual java.io.InputStream.close:()V
9: goto 11
10: StackMap locals: org.springframework.http.converter.ResourceHttpMessageConverter org.springframework.core.io.Resource org.springframework.http.HttpOutputMessage java.io.InputStream java.lang.Throwable
StackMap stack: java.lang.Throwable
pop
11: StackMap locals:
StackMap stack:
aload 4
athrow
12: StackMap locals:
StackMap stack:
aload 3
invokevirtual java.io.InputStream.close:()V
13: goto 17
14: StackMap locals:
StackMap stack: java.lang.Throwable
pop
end local 3 15: goto 17
16: StackMap locals: org.springframework.http.converter.ResourceHttpMessageConverter org.springframework.core.io.Resource org.springframework.http.HttpOutputMessage
StackMap stack: java.io.FileNotFoundException
pop
17: StackMap locals:
StackMap stack:
return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 this Lorg/springframework/http/converter/ResourceHttpMessageConverter;
0 18 1 resource Lorg/springframework/core/io/Resource;
0 18 2 outputMessage Lorg/springframework/http/HttpOutputMessage;
1 15 3 in Ljava/io/InputStream;
Exception table:
from to target type
1 2 3 Class java.lang.NullPointerException
4 5 6 Class java.lang.Throwable
1 4 7 any
8 9 10 Class java.lang.Throwable
12 13 14 Class java.lang.Throwable
0 15 16 Class java.io.FileNotFoundException
Exceptions:
throws java.io.IOException, org.springframework.http.converter.HttpMessageNotWritableException
MethodParameters:
Name Flags
resource
outputMessage
protected java.lang.Object readInternal(java.lang.Class, org.springframework.http.HttpInputMessage);
descriptor: (Ljava/lang/Class;Lorg/springframework/http/HttpInputMessage;)Ljava/lang/Object;
flags: (0x1044) ACC_PROTECTED, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=3, locals=3, args_size=3
0: aload 0
aload 1
checkcast java.lang.Class
aload 2
invokevirtual org.springframework.http.converter.ResourceHttpMessageConverter.readInternal:(Ljava/lang/Class;Lorg/springframework/http/HttpInputMessage;)Lorg/springframework/core/io/Resource;
areturn
LocalVariableTable:
Start End Slot Name Signature
Exceptions:
throws java.io.IOException, org.springframework.http.converter.HttpMessageNotReadableException
protected org.springframework.http.MediaType getDefaultContentType(java.lang.Object);
descriptor: (Ljava/lang/Object;)Lorg/springframework/http/MediaType;
flags: (0x1044) ACC_PROTECTED, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=2, locals=2, args_size=2
0: aload 0
aload 1
checkcast org.springframework.core.io.Resource
invokevirtual org.springframework.http.converter.ResourceHttpMessageConverter.getDefaultContentType:(Lorg/springframework/core/io/Resource;)Lorg/springframework/http/MediaType;
areturn
LocalVariableTable:
Start End Slot Name Signature
Exceptions:
throws java.io.IOException
protected java.lang.Long getContentLength(java.lang.Object, org.springframework.http.MediaType);
descriptor: (Ljava/lang/Object;Lorg/springframework/http/MediaType;)Ljava/lang/Long;
flags: (0x1044) ACC_PROTECTED, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=3, locals=3, args_size=3
0: aload 0
aload 1
checkcast org.springframework.core.io.Resource
aload 2
invokevirtual org.springframework.http.converter.ResourceHttpMessageConverter.getContentLength:(Lorg/springframework/core/io/Resource;Lorg/springframework/http/MediaType;)Ljava/lang/Long;
areturn
LocalVariableTable:
Start End Slot Name Signature
Exceptions:
throws java.io.IOException
protected void writeInternal(java.lang.Object, org.springframework.http.HttpOutputMessage);
descriptor: (Ljava/lang/Object;Lorg/springframework/http/HttpOutputMessage;)V
flags: (0x1044) ACC_PROTECTED, ACC_BRIDGE, ACC_SYNTHETIC
Code:
stack=3, locals=3, args_size=3
0: aload 0
aload 1
checkcast org.springframework.core.io.Resource
aload 2
invokevirtual org.springframework.http.converter.ResourceHttpMessageConverter.writeInternal:(Lorg/springframework/core/io/Resource;Lorg/springframework/http/HttpOutputMessage;)V
return
LocalVariableTable:
Start End Slot Name Signature
Exceptions:
throws java.io.IOException, org.springframework.http.converter.HttpMessageNotWritableException
}
Signature: Lorg/springframework/http/converter/AbstractHttpMessageConverter<Lorg/springframework/core/io/Resource;>;
SourceFile: "ResourceHttpMessageConverter.java"
NestMembers:
org.springframework.http.converter.ResourceHttpMessageConverter$1 org.springframework.http.converter.ResourceHttpMessageConverter$2
InnerClasses:
org.springframework.http.converter.ResourceHttpMessageConverter$1
org.springframework.http.converter.ResourceHttpMessageConverter$2