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

namespace Leaf.Nodes
{
    /// <summary>
    /// Node that stores arbitrary binary data.
    /// Stores the data as an array of bytes.
    /// </summary>
    public class BlobNode : Node
    {
        /// <summary>
        /// Retrieve the ID for the type of node.
        /// This can be used to identify, serialize, and cast a node to its type.
        /// The value returned by this property is <see cref="NodeId.Blob"/>.
        /// </summary>
        public override NodeId TypeId
        {
            get { throw new NotImplementedException(); }
        }

        /// <summary>
        /// Gets and sets the value of the node.
        /// </summary>
        public byte[] Bytes
        {
            get { throw new NotImplementedException(); }
            set { throw new NotImplementedException(); }
        }

        /// <summary>
        /// Creates a new node.
        /// </summary>
        /// <param name="bytes">Byte array of the data to store in the node.</param>
        public BlobNode(byte[] bytes)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Creates a new node by reading its contents from a stream.
        /// </summary>
        /// <param name="reader">Reader used to pull data from the stream.</param>
        /// <returns>Newly constructed node.</returns>
        internal BlobNode Read(BinaryReader reader)<commit_msg>Implement testable functionality of BlobNode<commit_after>﻿using System;
using System.IO;

namespace Leaf.Nodes
{
    /// <summary>
    /// Node that stores arbitrary binary data.
    /// Stores the data as an array of bytes.
    /// </summary>
    public class BlobNode : Node
    {
        private byte[] _bytes;

        /// <summary>
        /// Retrieve the ID for the type of node.
        /// This can be used to identify, serialize, and cast a node to its type.
        /// The value returned by this property is <see cref="NodeId.Blob"/>.
        /// </summary>
        public override NodeId TypeId
        {
            get { return NodeId.Blob; }
        }

        /// <summary>
        /// Gets and sets the value of the node.
        /// </summary>
        public byte[] Bytes
        {
            get { return _bytes; }
            set
            {
                if(value == null)
                    throw new ArgumentNullException();
                _bytes = value;
            }
        }

        /// <summary>
        /// Creates a new node.
        /// </summary>
        /// <param name="bytes">Byte array of the data to store in the node.</param>
        public BlobNode(byte[] bytes)
        {
            if(bytes == null)
                throw new ArgumentNullException("bytes");
            _bytes = bytes;
        }

        /// <summary>
        /// Creates a new node by reading its contents from a stream.
        /// </summary>
        /// <param name="reader">Reader used to pull data from the stream.</param>
        /// <returns>Newly constructed node.</returns>
        internal BlobNode Read(BinaryReader reader)
{'fraction_non_alphanumeric': 0.1151495657767771, 'fraction_numerical': 0.0, 'mean_word_length': 1.5121163166397416, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '7559141', 'n_tokens_mistral': 793, 'n_tokens_neox': 777, 'n_words': 292}