public FileContentBuffer(Context context, RegularInode inode, MetadataRef inodeRef) { _context = context; _inode = inode; context.InodeReader.SetPosition(inodeRef); context.InodeReader.Skip(_inode.Size); int numBlocks = (int)(_inode.FileSize / _context.SuperBlock.BlockSize); if (_inode.FileSize % _context.SuperBlock.BlockSize != 0 && _inode.FragmentKey == InvalidFragmentKey) { ++numBlocks; } byte[] lengthData = new byte[numBlocks * 4]; context.InodeReader.Read(lengthData, 0, lengthData.Length); _blockLengths = new int[numBlocks]; for (int i = 0; i < numBlocks; ++i) { _blockLengths[i] = Utilities.ToInt32LittleEndian(lengthData, i * 4); } }
public File(Context context, Inode inode, MetadataRef inodeRef) { _context = context; _inode = inode; _inodeRef = inodeRef; }
public MetablockReader(Context context, long start) { _context = context; _start = start; }