code: @Override
    public void close() throws IOException {
      if (!isOpen()) {
        throw new IOException("device is already closed");
      }
  
      session.closeDevice(handle);
      handle = null;
    }
docs: Closes the device.
  
  @throws IOException if an error occurs talking to the SANE backend
  @throws IllegalStateException if the device is already closed