A simple fix for save would be probably, creating the buffer with the data inside it, then open the file, save the buffer, close the file... it will be a lot faster and probably wouldn't error that much, and for loading, you can use byte[] buffer = File.ReadAllBytes(path); BinaryReader r = new BinaryReader(new MemoryStream(buffer));
|