コード例 #1
0
        private void TestDecoderAndInputStream(String expected, IoBuffer input)
        {
            // Test ProtocolDecoder
            IProtocolDecoder decoder = new ObjectSerializationDecoder();
            ProtocolCodecSession session = new ProtocolCodecSession();
            IProtocolDecoderOutput decoderOut = session.DecoderOutput;
            decoder.Decode(session, input.Duplicate(), decoderOut);

            Assert.AreEqual(1, session.DecoderOutputQueue.Count);
            Assert.AreEqual(expected, session.DecoderOutputQueue.Dequeue());
        }
コード例 #2
0
ファイル: IoBufferWrapper.cs プロジェクト: eltonfan/Mina.NET
 /// <inheritdoc/>
 public override IoBuffer Duplicate()
 {
     return(_buf.Duplicate());
 }
コード例 #3
0
 private void InternalFlush(INextFilter nextFilter, IoSession session, IoBuffer buf)
 {
     IoBuffer tmp = null;
     lock (buf)
     {
         buf.Flip();
         tmp = buf.Duplicate();
         buf.Clear();
     }
     if (log.IsDebugEnabled)
         log.Debug("Flushing buffer: " + tmp);
     nextFilter.FilterWrite(session, new DefaultWriteRequest(tmp));
 }
コード例 #4
0
 protected override Boolean DoDecode(IoSession session, IoBuffer input, IProtocolDecoderOutput output)
 {
     input.Duplicate(); // Will disable auto-expansion.
     Assert.IsFalse(input.AutoExpand);
     return base.DoDecode(session, input, output);
 }