refactoring for ability to extend EpollInputStream