// index <= BlockCount public void SetArrayBlock(int index, int number) // index , number block { byte[] buffer = new byte[4]; buffer = BitConverter.GetBytes(number); HDD.Write(buffer, SuperBlock.InodeStart + fileID * SuperBlock.InodeSize + index); arrayBlocks[index] = number; }
public static void SetArrayID(int index, byte value) { arrayID[index] = value; HDD.Write(new byte[1] { value }, SuperBlock.InodeTableStart + index); while (!HDD.isNullWriteHandler()) { ; } }
private static byte[] arrayBlock = new byte[SuperBlock.MaxBlocks];//0 if free else 1 public static void SetArrayBlock(int index, byte value) { arrayBlock[index] = value; HDD.Write(new byte[1] { value }, SuperBlock.FreeSpaceMgmtStart + index); while (!HDD.isNullWriteHandler()) { ; } }
public static void Main(string[] args) { Clock.SetTimer(); int intValue = 82; byte[] intValueOnByteArray = BitConverter.GetBytes(intValue); HDD.Write(intValueOnByteArray, 25); intValue = 19; //intValueOnByteArray = BitConverter.GetBytes(intValue); //HDD.Write(intValueOnByteArray, 24); byte[] h = new byte[40]; byte[] stringOnBytes; string s = "hes1a "; for (int i = 0; i < s.Length; i++) { stringOnBytes = BitConverter.GetBytes(s[i]); HDD.Write(stringOnBytes, i); } HDD.Read(ref h, 0, 40); while (!HDD.isNullReadHandler()) { ; } for (int i = 0; i < h.Length; i++) { Console.Write(i); Console.WriteLine(" " + h[i]); } }