public void RawRead(MmfFileView raw, int offset) { int count = raw.ReadInt32(offset); this.Data = new byte[count]; raw.Read(this.Data, offset + 4, count); }
public void RawWrite(MmfFileView view, int offset) { view.WriteUInt32(offset, this.Signature); offset += 4; view.WriteUInt32(offset, this.FreeSpace); offset += 4; view.WriteUInt32(offset, this.MaxFreeSpace); }
public void RawRead(MmfFileView view, int offset) { this.Signature = view.ReadUInt32(offset); offset += 4; this.FreeSpace = view.ReadUInt32(offset); offset += 4; this.MaxFreeSpace = view.ReadUInt32(offset); }
/// <summary> /// Abrea a visão. /// </summary> public virtual int Open() { _view = _mmf.MapView((ulong)(_vid * _size), _size); if (_view != null) { this.ReadHeader(); } return(0); }
/// <summary> /// Escreve os dados na view informada. /// </summary> /// <param name="raw"></param> /// <param name="offset"></param> public void RawWrite(MmfFileView raw, int offset) { raw.WriteByte(offset, this.Status); offset++; raw.WriteUInt32(offset, this.Capacity); offset += 4; raw.WriteUInt32(offset, this.OffsetNext); offset += 4; raw.WriteUInt32(offset, this.OffsetPrev); }
/// <summary> /// Lê os dados da view informada. /// </summary> /// <param name="raw"></param> /// <param name="offset"></param> public void RawRead(MmfFileView raw, int offset) { this.Status = raw.ReadByte(offset); offset++; this.Capacity = raw.ReadUInt32(offset); offset += 4; this.OffsetNext = raw.ReadUInt32(offset); offset += 4; this.OffsetPrev = raw.ReadUInt32(offset); }
/// <summary> /// Fecha a <see cref="View"/>. /// </summary> public virtual int Close() { if (this.IsOpen) { _mmf.UnMapView(_view); _view = null; _usage = 0; } return(0); }
public void UnMapView(MmfFileView view) { SafeNativeMethods.UnmapViewOfFile(view.ViewPtr); }
public void RawWrite(MmfFileView raw, int offset) { raw.WriteInt32(offset, this.Data.Length); raw.Write(this.Data, offset + 4, this.Data.Length); }