Return the correct length for input streams