public static MessageHeader Parse(Byte[] buffer) { return new MessageHeader(buffer.ReadInt32(0), buffer.ReadInt32(4), buffer.ReadInt32(8), buffer.ReadInt32(12)); }
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); }
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; }
public void Set(MemberInfo member, Object instance, Byte[] buffer, ref Int32 currentPosition) { member.SetValue(instance, buffer.ReadInt32(currentPosition)); currentPosition += sizeof (Int32); }