I read this post but I am not following. I have seen this but have not seen a proper example of converting a ByteArrayInputStream to String using
ByteArrayInputStream
String
Why nobody mentioned org.apache.commons.io.IOUtils?
org.apache.commons.io.IOUtils
import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; String result = IOUtils.toString(in, StandardCharsets.UTF_8);
Just one line of code.