Hello,
I had developed a custom REST service to get content based on object id and then converting the content InputStream to Base64 encoded string. Post that I am writing Base64 encoded string to HttpServletResponse.
InputStream is = ...
byte[] contentByteArray = ...
String encodedContentString = Base64.getEncoder().encodeToString(contentByteArray);
Sysout.out.println(encodedContentString); _//Getting fullcontent_
response.getWriter().write(encodedContentString); _//HttpServletResponse response_
I had noticed that response body received through HttpServletResponse is less in characters when compared to the encodedContentString. The String is getting truncated while getting response.
Any inputs on how to handle or resolve this issue.
Thanks.
Best Regards,
Shailendra Chandak