private void WriteBytes(
byte[] bytes)
{
int pos = 0;
int remaining = bytes.Length;
char[] buf = new char[LineLength];
while (remaining > LineLength)
{
Encoding.ASCII.GetChars(bytes, pos, LineLength, buf, 0);
writer.WriteLine(buf);
pos += LineLength;
remaining -= LineLength;
}
Encoding.ASCII.GetChars(bytes, pos, remaining, buf, 0);
writer.WriteLine(buf, 0, remaining);
}
}