1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- public abstract class Disk
- {
- private bool m_isReadOnly = false;
-
-
-
- public abstract byte[] ReadSectors(long sectorIndex, int sectorCount);
- public abstract void WriteSectors(long sectorIndex, byte[] data);
- public byte[] ReadSector(long sectorIndex)
- {
- return ReadSectors(sectorIndex, 1);
- }
- public bool IsReadOnly
- {
- get
- {
- return m_isReadOnly;
- }
- set
- {
- m_isReadOnly = value;
- }
- }
- public abstract int BytesPerSector
- {
- get;
- }
- public abstract long Size
- {
- get;
- }
- public long TotalSectors
- {
- get
- {
- return this.Size / this.BytesPerSector;
- }
- }
- }
|