<commit_before>﻿using System.IO;
using System.Text;

namespace NuGetPe
{
    public static class StreamUtility
    {
        public static Stream ToStream(string content)
        {
            return new MemoryStream(Encoding.UTF8.GetBytes(content));
        }

        public static Stream MakeSeekable(Stream stream, bool disposeOriginal = false)
        {
            if (stream.CanSeek)
            {<commit_msg>null checks<commit_after>﻿using System.IO;
using System.Text;

namespace NuGetPe
{
    public static class StreamUtility
    {
        public static Stream ToStream(string content)
        {
            if (content is null)
                throw new System.ArgumentNullException(nameof(content));

            return new MemoryStream(Encoding.UTF8.GetBytes(content));
        }

        public static Stream MakeSeekable(Stream stream, bool disposeOriginal = false)
        {
            if (stream is null)
                throw new System.ArgumentNullException(nameof(stream));

            if (stream.CanSeek)
            {
{'fraction_non_alphanumeric': 0.07293666026871401, 'fraction_numerical': 0.0019193857965451055, 'mean_word_length': 2.1993865030674846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6247846', 'n_tokens_mistral': 270, 'n_tokens_neox': 263, 'n_words': 71}