InputStream.read(byte[]) only blocks until at least one byte is read. This means it can return having read less than the length of the array, which can result in an EOFException being thrown even though the end of the stream has not been reached.
I noticed this issue when calling MXFFragmentBuilder.fromInputStream with different types of InputStream. Reading an MXF file with FileInputStream worked ok, but the same MXF file being read from an S3 bucket would result in an EOFException.
InputStream.read(byte[])
only blocks until at least one byte is read. This means it can return having read less than the length of the array, which can result in anEOFException
being thrown even though the end of the stream has not been reached.I noticed this issue when calling
MXFFragmentBuilder.fromInputStream
with different types ofInputStream
. Reading an MXF file withFileInputStream
worked ok, but the same MXF file being read from an S3 bucket would result in anEOFException
.