public NonResidentAttributeBuffer(File file, NtfsAttribute attribute) : base(file.Context, CookRuns(attribute), file.IndexInMft == MasterFileTable.MftIndex) { _file = file; _attribute = attribute; switch (attribute.Flags & (AttributeFlags.Compressed | AttributeFlags.Sparse)) { case AttributeFlags.Sparse: _activeStream = new SparseClusterStream(_attribute, _rawStream); break; case AttributeFlags.Compressed: _activeStream = new CompressedClusterStream(_context, _attribute, _rawStream); break; case AttributeFlags.None: _activeStream = _rawStream; break; default: throw new NotImplementedException("Unhandled attribute type '" + attribute.Flags + "'"); } }