Example #1
0
        /// <summary>
        /// Read several consecutives sectors's data
        /// </summary>
        /// <param name="count">Number of sectors to read</param>
        /// <param name="mode">Sector's mode</param>
        public byte[] ReadSectors(int count, SectorMode mode)
        {
            int dataSize = GetSectorDataSize(mode);

            byte[] data = new byte[count * dataSize];

            for (int i = 0, offset = 0; i < count; i++, offset += dataSize)
            {
                CBuffer.Copy(ReadSector(mode), data, 0, offset);
            }

            return(data);
        }
Example #2
0
        /// <summary>
        /// Convert the DateTime to specific datetime format of descriptor
        /// </summary>
        /// <param name="date">The date to convert</param>
        internal static byte[] FromDateTime(DateTime date)
        {
            string value = "";

            byte[] buffer = new byte[17];

            value += DatePartToString(date.Year, 4);
            value += DatePartToString(date.Month, 2);
            value += DatePartToString(date.Day, 2);
            value += DatePartToString(date.Hour, 2);
            value += DatePartToString(date.Minute, 2);
            value += DatePartToString(date.Second, 2);
            value += DatePartToString(date.Millisecond / 10, 2);

            CBuffer.Copy(Encoding.ASCII.GetBytes(value), buffer);

            return(buffer);
        }
Example #3
0
 /// <summary>
 /// Copy the application-reserved zone of the iso (pvd's Application Data)
 /// </summary>
 /// <param name="diskIn"></param>
 public void CopyApplicationData(DataTrackReader diskIn)
 {
     CBuffer.Copy(diskIn.PrimaryVolumeDescriptor.ApplicationData, _primaryVolumeDescriptor.ApplicationData);
 }