ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
ImageResizer.Plugins.SourceMemCache.CachedVirtualFile Class Reference
Inheritance diagram for ImageResizer.Plugins.SourceMemCache.CachedVirtualFile:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.SourceMemCache.CachedVirtualFile:
Collaboration graph
[legend]

Public Member Functions

 CachedVirtualFile (string virtualPath, byte[] data)
 
System.IO.Stream Open ()
 Returns an opened stream to the file contents. More...
 

Protected Member Functions

int CaluclateHash ()
 

Protected Attributes

int originalHash = -1
 

Properties

string VirtualPath [get]
 
long BytesOccupied [get]
 
- Properties inherited from ImageResizer.Plugins.IVirtualFile
string VirtualPath [get]
 The virtual path of the file (relative to the domain, like /app/folder/file.ext) More...
 

Detailed Description

Definition at line 66 of file SourceMemCache.cs.

Member Function Documentation

System.IO.Stream ImageResizer.Plugins.SourceMemCache.CachedVirtualFile.Open ( )
inline

Returns an opened stream to the file contents.

Returns

Implements ImageResizer.Plugins.IVirtualFile.

Definition at line 80 of file SourceMemCache.cs.

80  {
81  if (checkIntegrity) {
82  if (originalHash == -1) originalHash = CaluclateHash();
83  else if (originalHash != CaluclateHash()) throw new AccessViolationException("A read-only memory stream was somehow modified.");
84  }
85 
86  return new MemoryStream(data, false);
87  }

The documentation for this class was generated from the following file: