C# (CSharp) Apache.NMS.Util EndianBinaryWriter.WriteString16 - 3 examples found. These are the top rated real world C# (CSharp) examples of Apache.NMS.Util.EndianBinaryWriter.WriteString16 extracted from open source projects. You can rate examples to help us improve the quality of examples.
Method WriteString16, writes a string to the output using the Java standard modified UTF-8 encoding with an unsigned short value written first to indicate the length of the encoded data, the short is read as an unsigned value so the max amount of data this method can write is 65535 encoded bytes. Unlike the WriteString32 method this method does not encode the length value to -1 if the string is null, this is to match the behaviour of the Java DataOuputStream class's writeUTF method. Because modified UTF-8 encding can result in a number of bytes greater that the size of the String this method must first check that the encoding proces will not result in a value that cannot be written becuase it is greater than the max value of an unsigned short.