Can take a Stream object instead of a file path as the input argument