private void ReadCache(ResSetCollection buff)
        {
            // 新規に開く場合のみキャッシュを読み込む
            if (modeOpen)
            {
                if (ThreadIndexer.Exists(Cache, headerInfo))
                {
                    ThreadIndexer.Read(Cache, headerInfo);

                    try
                    {
                        storage            = new LocalThreadStorage(Cache, headerInfo, StorageMode.Read);
                        storage.BufferSize = bufferSize;

                        // すべてのレスを読み込み表示
                        while (storage.Read(buff) != 0)
                        {
                            ;
                        }
                    }
                    finally
                    {
                        if (storage != null)
                        {
                            storage.Close();
                            storage = null;
                        }
                    }

                    buff.IsNew = false;
                }
            }
        }
        /// <summary>
        /// データを読み込む&書き込む
        /// </summary>
        private void Reading()
        {
            ResSetCollection items = new ResSetCollection(),
                             buffer = new ResSetCollection();
            int read = -1, byteParsed, totalByteCount = 0;

            while (read != 0)
            {
                if (canceled)
                {
                    return;
                }

                read = reader.Read(buffer, out byteParsed);

                // あぼーんを検知した場合、処理を中止。
                if (read == -1)
                {
                    aboneDetected = true;
                    return;
                }

                totalByteCount += byteParsed;

                items.AddRange(buffer);

                // 逐次受信の場合はビューアに書き込む
                if (!isPackageReception)
                {
                    if (canceled)
                    {
                        return;
                    }

                    Invoke(new WriteResMethodInvoker(WriteInternal), new object[] { buffer });
                }
                buffer.Clear();

                OnReceive(new ReceiveEventArgs(
                              reader.Length, reader.Position, read));

                OnStatusTextChanged(
                    String.Format("{0} 受信中 ({1}/{2})",
                                  headerInfo.Subject, reader.Position, reader.Length));
            }

            // 一括受信の場合はここで一気にフラッシュ
            if (isPackageReception)
            {
                if (canceled)
                {
                    return;
                }

                Invoke(new WriteResMethodInvoker(WriteInternal), new object[] { items });
            }

            try
            {
                // スレッドのインデックス情報を保存
                storage            = new LocalThreadStorage(Cache, headerInfo, StorageMode.Write);
                storage.BufferSize = bufferSize;
                storage.Write(items);

                headerInfo.GotByteCount += totalByteCount;
                headerInfo.GotResCount  += items.Count;
                headerInfo.NewResCount   = items.Count;
                ThreadIndexer.Write(Cache, headerInfo);
            }
            catch (Exception ex)
            {
                TwinDll.Output(ex);
            }
            finally
            {
                storage.Close();
            }

            SaveThreadListIndices();
        }