util: Added Common.getBytesIOString and use it where we need to return bytesIO.getvalue().