Implemented available() method for input streams

Tested on windows (8) and ubuntu (13)