<commit_before>using System.Collections.Generic;
using System.Text;

/// <summary>
/// A string that is encoded as a byte array.
/// </summary>
public struct ByteString
{
    /// <summary>
    /// Creates a byte string from the given data.
    /// </summary>
    /// <param name="Data">The data for this byte string.</param>
    public ByteString(byte[] Data)
    {
        this.byteArray = Data;
    }

    private byte[] byteArray;

    /// <summary>
    /// Gets a Boolean flag that tells if this byte string is the null byte string.
    /// </summary>
    public bool IsNullByteString => byteArray == null;

    /// <summary>
    /// Gets this byte string's underlying byte array.
    /// </summary>
    /// <returns>The underlying byte array.</returns>
    public byte[] Bytes => byteArray;

    /// <summary>
    /// Gets this byte string's data as a UTF-8 string.
    /// </summary>
    /// <returns>A string.</returns>
    public string Utf8String 
    {
        get
        {
            if (IsNullByteString)
                return null;
            else
                return UTF8Encoding.UTF8.GetString(byteArray);
        }
    }
}<commit_msg>Give ByteString a ToString override<commit_after>using System.Collections.Generic;
using System.Text;

/// <summary>
/// A string that is encoded as a byte array.
/// </summary>
public struct ByteString
{
    /// <summary>
    /// Creates a byte string from the given data.
    /// </summary>
    /// <param name="Data">The data for this byte string.</param>
    public ByteString(byte[] Data)
    {
        this.byteArray = Data;
    }

    private byte[] byteArray;

    /// <summary>
    /// Gets a Boolean flag that tells if this byte string is the null byte string.
    /// </summary>
    public bool IsNullByteString => byteArray == null;

    /// <summary>
    /// Gets this byte string's underlying byte array.
    /// </summary>
    /// <returns>The underlying byte array.</returns>
    public byte[] Bytes => byteArray;

    /// <summary>
    /// Gets this byte string's data as a UTF-8 string.
    /// </summary>
    /// <returns>A string.</returns>
    public string Utf8String 
    {
        get
        {
            if (IsNullByteString)
                return null;
            else
                return UTF8Encoding.UTF8.GetString(byteArray);
        }
    }

    public override string ToString()
    {
        return Utf8String;
    }
}
{'fraction_non_alphanumeric': 0.128003314001657, 'fraction_numerical': 0.003728251864125932, 'mean_word_length': 1.8818615751789975, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, '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': '2461478', 'n_tokens_mistral': 681, 'n_tokens_neox': 659, 'n_words': 222}