Try-with-resources when calling super constructor
<p>Is there any good way of using try-with-resources when opening an <code>InputStream</code> in a constructor and then passing that to a super constructor?</p>

<p>Basically what I want to do is this:</p>

<pre><code>public class A {
    public A(InputStream stream) {
        // Do something with the stream but don't close it since we didn't open it
    }
}

public class B {
    public B(File file) {
        // We open the stream so we need to ensure it's properly closed
        try (FileInputStream stream = new FileInputStream(file)) {
            super(new FileInputStream(file));
        }
    }
}
</code></pre>

<p>But, of course, since <code>super</code> must be the first statement in the constructor this isn't allowed. Is there any good way of achieving this?</p>