Make signature functions work with inputsteams in efficient way.