Exemple #1
0
 public static ICoreMessage Decode(IByteBuffer buffer)
 {
     using (var r = new ReadOnlyByteBufferStream(buffer, false).ToBinaryReader(false))
     {
         var opCode = r.ReadEnum <ProudCoreOpCode>();
         return(CoreMessageFactory.Default.GetMessage(opCode, r));
     }
 }
Exemple #2
0
        public static ICoreMessage Decode(IByteBuffer buffer)
        {
            using (var r = new ReadOnlyByteBufferStream(buffer, false).ToBinaryReader(false))
            {
                if (r.IsEOF())
                {
                    throw new ProudException("Empty packet");
                }

                var opCode = r.ReadEnum <ProudCoreOpCode>();
                return(CoreMessageFactory.Default.GetMessage(opCode, r));
            }
        }