How to represent an empty InputStream
Since Java 11, you could use a static method InputStream.nullInputStream(): Returns a new InputStream that reads no bytes. The returned stream is initially open. The stream is closed by calling the close() method. Subsequent calls to close() have no effect.