add getBytesAvailable