This PR adds 3 Write methods to allow defining the string terminator token, so it can be different to \0.
public void Write(string text, string terminator, Encoding encoding = null, int maxSize = -1);
public void Write(string text, int fixedSize, string terminator, Encoding encoding = null);
public void Write(string text, Type sizeType, string terminator, Encoding encoding = null, int maxSize = -1);
Example
The usage is similar to the old methods, but defining a string parameter to use as string terminator.
writer.Write("hello", "."); // Writes "hello." on the stream using the default writer encoding.
writer.Write("hello", 4, ".", Encoding.GetEncoding("utf-8")); // Writes "hel." on the stream
writer.Write("hello", typeof(ushort), "."); // Writes the string length as a ushort and then "hello." on the stream
Description
This PR adds 3
Write
methods to allow defining the string terminator token, so it can be different to\0
.Example
The usage is similar to the old methods, but defining a
string
parameter to use as string terminator.Linked issue: No