code: private InputStream getInIfOpen() throws IOException {
          InputStream input = in;
          if (input == null)
              throw new IOException("Stream closed");
          return input;
      }
docs: Check to make sure that underlying input stream has not been
  nulled out due to close; if not return it;