SystemExt/Network/TCPClientBase.cs
/// <summary>
/// Write a string to the client.
/// </summary>
/// <param name="data">
/// The string to write to the client.
/// </param>
/// <param name="offset">
/// The offset from the start of <see cref="data"/> to start writing.
/// </param>
/// <param name="count">
/// The maximum number of characters to write.
/// </param>
/// <param name="encoding">
/// The encoding which the string should be decoded with.
/// </param>
/// <returns>
/// True if starting the write succeeded, otherwise false.
/// </returns>
Write a string to the client.
Write a string to the client .
public bool Write(string data, int offset, int count, Encoding encoding = null)
        {
            if (encoding == null)
                encoding = Encoding.UTF8;
            var bytes = Maybe<byte[]>.FromThrowingFunc(() => encoding.GetBytes(data.Substring(offset, count)));
            return bytes.HasValue && this.Write(bytes.Get());
        }
public bool Write ( string data , int offset , int count , Encoding encoding = null ) { if ( encoding == null ) encoding = Encoding . UTF8 ; var bytes = Maybe < byte [ ] > . FromThrowingFunc ( ( ) => encoding . GetBytes ( data . Substring ( offset , count ) ) ) ; return bytes . HasValue && this . Write ( bytes . Get ( ) ) ; }
Write a string to the client.
Write a string to the client .
// Default to UTF-8 if an encoding is not specified. // Decode the string to a byte array and send it.
True if starting the write succeeded, otherwise false.
True if starting the write succeeded otherwise false .
data
string
The string to write to the client.
The string to write to the client .
offset
int
The offset from the start of  to start writing.
The offset from the start of to start writing .
count
int
The maximum number of characters to write.
The maximum number of characters to write .
encoding
Encoding
The encoding which the string should be decoded with.
The encoding which the string should be decoded with .