System.IO.UnmanagedMemoryStream.UnmanagedMemoryStream.Initialize C# (CSharp) Méthode

Initialize() protected méthode

protected Initialize ( byte pointer, long length, long capacity, FileAccess access ) : void
pointer byte
length long
capacity long
access FileAccess
Résultat void
		protected unsafe void Initialize (byte* pointer, long length,
						  long capacity,
						  FileAccess access)
		{
			if (pointer == null)
				throw new ArgumentNullException("pointer");
			if (length < 0)
				throw new ArgumentOutOfRangeException("length", "Non-negative number required.");
			if (capacity < 0)
				throw new ArgumentOutOfRangeException("capacity", "Non-negative number required.");
			if (length > capacity)
				throw new ArgumentOutOfRangeException("length", "The length cannot be greater than the capacity.");
			if ((access < FileAccess.Read) || (access > FileAccess.ReadWrite))
				throw new ArgumentOutOfRangeException ("access", "Enum value was out of legal range.");
				
			fileaccess = access;
			this.length = length;
			this.capacity = capacity;
			initial_position = 0;
			current_position = initial_position;
			initial_pointer = new IntPtr ((void*)pointer);
			closed = false;
		}
#endregion