Sub Main() Dim I As Int32 Dim f AsNew FileStream("E:BigFile.big", FileMode.Create) Dim fw AsNew BinaryWriter(f) Dim fr AsNew BinaryReader(f) Dim Size As Int32 = 1024 * 1024 * 1024 - 1? 'File size = 1GB Dim bufSize As Int32 = 30 * 1024 * 1024? 'Buffer Size = 30MB Dim jLast As Int32 = bufSize - 1 Dim j As Int32 Dim Bytes(bufSize) AsByte Dim StartWrite AsDate = Date.Now Console.WriteLine("Write Start at {0}", StartWrite) Console.WriteLine("Creating...") For I = 0To Size Step bufSize '1GB fw.Write(Bytes) Next Dim EndWrite AsDate = Date.Now Dim TimePassed As TimeSpan = EndWrite.Subtract(StartWrite) Console.WriteLine("Write End at {0}", EndWrite) Console.WriteLine("Time passed:{0}", TimePassed) Console.WriteLine("Speed:{0}", 1000 / TimePassed.TotalSeconds) fw.Flush() Dim StartRead AsDate = Date.Now Console.WriteLine("Read Start at {0}", StartRead) Console.WriteLine("Reading") For I = 0To Size Step bufSize Bytes = fr.ReadBytes(bufSize) Next Dim EndRead AsDate = Date.Now TimePassed = EndRead.Subtract(StartRead) Console.WriteLine("Read End at {0}", EndRead) Console.WriteLine("Time passed:{0}", TimePassed) Console.WriteLine("Read speed:{0}", 1000 / TimePassed.TotalSeconds) Console.ReadLine() fw.Close() EndSub
This program wrote for Siemens M55 Cellphone. But until now I can’t successfully connect to all M55 phone due to the Connection problem. So the code of Connection portion is only for reference.
This whole program has core functions and I have no time to write a better visual. Some part will course failures.
You can use and modify this program freely. But when you fixed some bugs, please send me the copy. The core class can be references of other programs.
下载地址:[download id=”26”] 谢谢下载和关注! Thanks for download!