import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPOutputStream;

public class JI9049212 {

	public static void main(String[] args) throws IOException {
		try (GZIPOutputStream out = new GZIPOutputStream(new ThrowingOutputStream())) { 

		} finally { 
			System.out.println("Stream closed? " + ThrowingOutputStream.isClosed()); 
		} 

	}
	
	public static class ThrowingOutputStream extends OutputStream { 
        private static boolean closed = false; 

        public static boolean isClosed() { 
            return closed; 
        } 

        @Override 
        public void write(final int b) throws IOException { 
            throw new IOException(); 
        } 

        @Override 
        public void close() throws IOException { 
            closed = true; 
        } 
    } 
}
