using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SuperWebSocket { /// /// Text encoding binary data converter /// public class TextEncodingBinaryDataConverter : IBinaryDataConverter { /// /// Gets the encoding. /// /// /// The encoding. /// public Encoding Encoding { get; private set; } /// /// Initializes a new instance of the class. /// /// The encoding. public TextEncodingBinaryDataConverter(Encoding encoding) { Encoding = encoding; } /// /// Returns a that represents this instance. /// /// The data. /// The offset. /// The length. /// /// A that represents this instance. /// public string ToString(byte[] data, int offset, int length) { return Encoding.GetString(data, offset, length); } } }