public void TestGetPrefixedString() { IoBuffer buf = IoBuffer.Allocate(16); Encoding encoding = Encoding.GetEncoding("ISO-8859-1"); buf.PutInt16((short)3); buf.PutString("ABCD", encoding); buf.Clear(); Assert.AreEqual("ABC", buf.GetPrefixedString(encoding)); }
protected override Boolean DoDecode(IoSession session, IoBuffer input, IProtocolDecoderOutput output) { if (input.PrefixedDataAvailable(PrefixLength, MaxDataLength)) { String msg = input.GetPrefixedString(PrefixLength, Encoding); output.Write(msg); return true; } return false; }
/// <inheritdoc/> public override String GetPrefixedString(Encoding encoding) { return(_buf.GetPrefixedString(encoding)); }