File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
main/java/org/springframework/http/converter
test/java/org/springframework/http/converter Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -94,12 +94,9 @@ public boolean supports(Class<?> clazz) {
94
94
protected String readInternal (Class <? extends String > clazz , HttpInputMessage inputMessage ) throws IOException {
95
95
Charset charset = getContentTypeCharset (inputMessage .getHeaders ().getContentType ());
96
96
long length = inputMessage .getHeaders ().getContentLength ();
97
- final byte [] bytes ;
98
- if (length >= 0 && length <= Integer .MAX_VALUE ) {
99
- bytes = inputMessage .getBody ().readNBytes ((int ) length );
100
- } else {
101
- bytes = inputMessage .getBody ().readAllBytes ();
102
- }
97
+ byte [] bytes = (length >= 0 && length <= Integer .MAX_VALUE ?
98
+ inputMessage .getBody ().readNBytes ((int ) length ) :
99
+ inputMessage .getBody ().readAllBytes ());
103
100
return new String (bytes , charset );
104
101
}
105
102
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
You can’t perform that action at this time.
0 commit comments