Simplify conversion of ByteArrayOutputStream to String

Closes gh-24785
This commit is contained in:
Сергей Цыпанов
2020-03-26 10:54:40 +02:00
committed by Sam Brannen
parent 62c545d0ed
commit 65aa2d03f0
4 changed files with 6 additions and 7 deletions

View File

@@ -183,7 +183,7 @@ public class ProtobufMessageConverter extends AbstractMessageConverter {
else if (this.protobufFormatSupport != null) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
this.protobufFormatSupport.print(message, outputStream, contentType, charset);
payload = new String(outputStream.toByteArray(), charset);
payload = outputStream.toString(charset.name());
}
}
catch (IOException ex) {