To hide away the conversion from ASCII to bytes, I wrote this function:
Code: Select all
static void writeToStream(Stream s, string data)
{
byte[] b = Encoding.ASCII.GetBytes(data);
s.Write(b, 0, b.Length);
}
Code: Select all
writeToStream(s, "<");
s.WriteByte((byte)lut[n.Name]);
writeToStream(s, ">");
The byte however is not in the stream at all, it's just gone..
Strangely enough, the single byte suddenly appears when it is written like this:
Code: Select all
writeToStream(s, "<<");
s.WriteByte((byte)lut[n.Name]);
writeToStream(s, ">");
What am I missing here?