sandflow / regxmllib

Convert MXF to XML: RegXML (SMPTE ST 2001-1) tools and libraries
BSD 2-Clause "Simplified" License
35 stars 14 forks source link

Erroneous EOFException in KLVInputStream #139

Closed bencampion closed 5 years ago

bencampion commented 5 years ago

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.