/// <summary>
        /// resCollectionをファイルに書き込む
        /// </summary>
        /// <param name="resCollection">スレッドの内容が格納されたResSetCollectionクラス</param>
        /// <returns>実際に書き込まれたバイト数</returns>
        public override int Write(ResSetCollection resCollection)
        {
            if (!CanWrite)
            {
                throw new NotSupportedException("書き込み用に開かれていません");
            }
            if (resCollection == null)
            {
                throw new ArgumentNullException("resCollection");
            }
            if (!isOpen)
            {
                throw new InvalidOperationException("ストリームが開かれていません");
            }

            string textData = formatter.Format(resCollection);

            byte[] byteData = encoding.GetBytes(textData);

            baseStream.Write(byteData, 0, byteData.Length);
            position += byteData.Length;

            return(byteData.Length);
        }