Пример #1
0
 public void Create()
 {
     ChsAddress g = new ChsAddress(100, 16, 63);
     Assert.AreEqual(100, g.Cylinder);
     Assert.AreEqual(16, g.Head);
     Assert.AreEqual(63, g.Sector);
 }
        public void Create()
        {
            ChsAddress g = new ChsAddress(100, 16, 63);

            Assert.AreEqual(100, g.Cylinder);
            Assert.AreEqual(16, g.Head);
            Assert.AreEqual(63, g.Sector);
        }
Пример #3
0
        public void LBARoundTrip()
        {
            Geometry g = new Geometry(100, 16, 63);

            const int TestCylinder = 54;
            const int TestHead     = 15;
            const int TestSector   = 63;

            long       lba = g.ToLogicalBlockAddress(TestCylinder, TestHead, TestSector);
            ChsAddress chs = g.ToChsAddress(lba);

            Assert.AreEqual(TestCylinder, chs.Cylinder);
            Assert.AreEqual(TestHead, chs.Head);
            Assert.AreEqual(TestSector, chs.Sector);
        }
Пример #4
0
 /// <summary>
 /// Converts a CHS (Cylinder,Head,Sector) address to a LBA (Logical Block Address).
 /// </summary>
 /// <param name="chsAddress">The CHS address to convert</param>
 /// <returns>The Logical Block Address (in sectors)</returns>
 public long ToLogicalBlockAddress(ChsAddress chsAddress)
 {
     return(ToLogicalBlockAddress(chsAddress.Cylinder, chsAddress.Head, chsAddress.Sector));
 }
Пример #5
0
 /// <summary>
 /// Converts a CHS (Cylinder,Head,Sector) address to a LBA (Logical Block Address).
 /// </summary>
 /// <param name="chsAddress">The CHS address to convert</param>
 /// <returns>The Logical Block Address (in sectors)</returns>
 public long ToLogicalBlockAddress(ChsAddress chsAddress)
 {
     return ToLogicalBlockAddress(chsAddress.Cylinder, chsAddress.Head, chsAddress.Sector);
 }