Пример #1
0
 public static MessageHeader Parse(Byte[] buffer)
 {
     return new MessageHeader(buffer.ReadInt32(0),
                              buffer.ReadInt32(4),
                              buffer.ReadInt32(8),
                              buffer.ReadInt32(12));
 }
Пример #2
0
 public static OpReplyMessage Parse(Byte[] buffer)
 {
     var header = MessageHeader.Parse(buffer);
     return new OpReplyMessage(header,
                               (OpReplyFlags) buffer.ReadInt32(MessageHeader.MessageLength),
                               buffer.ReadInt32(MessageHeader.MessageLength + 4), // TODO: Int32 not good!
                               buffer.ReadInt32(MessageHeader.MessageLength + 12),
                               buffer.ReadInt32(MessageHeader.MessageLength + 16),
                               buffer);
 }
Пример #3
0
 public void Set(MemberInfo member, Object instance, Byte[] buffer, ref Int32 currentPosition)
 {
     var length = buffer.ReadInt32(currentPosition);
     currentPosition += sizeof (Int32);
     member.SetValue(instance, _encoding.GetString(buffer, currentPosition, length - 1));
     currentPosition += length;
 }
Пример #4
0
 public void Set(MemberInfo member, Object instance, Byte[] buffer, ref Int32 currentPosition)
 {
     member.SetValue(instance, buffer.ReadInt32(currentPosition));
     currentPosition += sizeof (Int32);
 }