blob: 685c8dea4165bec3a7378cd66b0edfea729e90e6 [file] [log] [blame]
//file
import java.io.*;
interface I {
int doIt(InputStream stream) throws IOException;
}
public class C {
int foo() throws IOException {
try(InputStream stream = new ByteArrayInputStream(new byte[10])) {
if (stream.read() >= 0) {
return bar(new I() {
@Override
public int doIt(InputStream stream) throws IOException {
return stream.available();
}
}, stream);
}
}
return -1;
}
int bar(I i, InputStream stream) throws IOException {
return i.doIt(stream);
}
}