I'm not sure I see the problem here. You're saying that the length is the length of the file size. Sounds like you're getting the whole file. I can't reproduce this... in fact, I tried:
string test = "This is a test... it is only a test";
byte[] bytes = Encoding.Default.GetBytes(test);
byte[] newBytes = new byte[bytes.Length + 2];
Array.Copy(bytes, newBytes, 12);
Array.Copy(bytes, 12, newBytes, 14, bytes.Length - 12);
File.WriteAllBytes(@"C:\dump\reallyGoodFile.txt", newBytes);
string file = File.ReadAllText(@"C:\dump\reallyGoodFile.txt");
Console.WriteLine(file);
Do you have code that shows your problem?
Coding Light - Illuminated Ideas and Algorithms in SoftwareCoding Light Wiki •
LinkedIn •
ForumsBrowser