private static void WriteShort(FileStream fs, short val) { fs.WriteByte((byte)(val & 0x00ff)); fs.WriteByte((byte)((val & 0x0ff00) >> 8)); }