View Single Post
  #2 (permalink)  
Old 01-07-2009, 11:51 AM
MattP MattP is offline
VB.NET Forum Idol
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Feb 2008
Location: USA
Posts: 866
Reputation: 499
MattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond reputeMattP has a reputation beyond repute
Default

I wrote 300,000 single values to a binary file for testing. Reading the contents into a List(Of Single) took about 5 seconds on my system (low end Core 2 Duo).

Code:
		Dim singleCollection As New List(Of Single)

		Using reader As New BinaryReader(File.OpenRead("C:\Temp\BinaryFile.dat"))
			Do Until reader.PeekChar() = -1
				singleCollection.Add(reader.ReadSingle())
			Loop
		End Using
Reply With Quote