Skip to content

Commit

Permalink
Polish contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Aug 4, 2023
1 parent 7636eec commit c050642
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -94,12 +94,9 @@ public boolean supports(Class<?> clazz) {
protected String readInternal(Class<? extends String> clazz, HttpInputMessage inputMessage) throws IOException {
Charset charset = getContentTypeCharset(inputMessage.getHeaders().getContentType());
long length = inputMessage.getHeaders().getContentLength();
final byte[] bytes;
if (length >= 0 && length <= Integer.MAX_VALUE) {
bytes = inputMessage.getBody().readNBytes((int) length);
} else {
bytes = inputMessage.getBody().readAllBytes();
}
byte[] bytes = (length >= 0 && length <= Integer.MAX_VALUE ?
inputMessage.getBody().readNBytes((int) length) :
inputMessage.getBody().readAllBytes());
return new String(bytes, charset);
}

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit c050642

Please sign in to comment.