Class ExactSizeInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
fr.gouv.vitam.common.stream.ExactSizeInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ExactSizeInputStream extends FilterInputStream
Input stream that checks input stream size (avoids premature EOF or invalid file size) This input stream guaranties that an exception occur BEFORE the last data byte is returned. For empty streams (size=0), EOF check is done at constructor initialization time.