Пример #1
0
 public IEnumerable <ChunkedFileDataDescriptor> ToChunkedFileDataDescriptor()
 {
     for (int i = 0; i < ChunkCount; i++)
     {
         FileChunk chunk = this[i];
         yield return(new ChunkedFileDataDescriptor
         {
             ChunkData = chunk.ToChunkData(),
             ChunkDataDescriptor = chunk.ToChunkDataDescriptor()
         });
     }
 }
Пример #2
0
 public FileChunk this[int chunkIndex]
 {
     get
     {
         FileChunk chunk = new FileChunk();
         chunk.ChunkIndex = chunkIndex;
         chunk.FileHash   = FileHash;
         long streamIndex;
         chunk.ByteData    = ReadChunk(chunkIndex, out streamIndex);
         chunk.StreamIndex = streamIndex;
         chunk.ChunkLength = chunk.ByteData.Length;
         return(chunk);
     }
 }