I have two different scenarios where I am trying to connect an InputStream with OutputStream and both of the above scenarios are working as expected when the size of the dat