LPS-45067 Avoid inputStream lost bytes when add file entry