public void testWriteString16_invalidEncodingHeader()
{
// Set one of the 65535 bytes to a value that will result in a 2 byte UTF8 encoded sequence.
// This will cause the string of length 65535 to have a utf length of 65536.
MemoryStream stream = new MemoryStream();
EndianBinaryWriter writer = new EndianBinaryWriter(stream);
String testStr = new String('a', 65535);
char[] array = testStr.ToCharArray();
array[0] = '\u0000';
testStr = new String(array);
writer.Write(testStr);
}