Do not open the device in the InputOperation class . Open the device and then pass the file description to it is better .