public override Payload Encode(char[] buffer, int offset, int length) { Payload result = new Payload(); float payload = Single.Parse(new string(buffer, offset, length)); // TODO: improve this so that we don't have to new Strings byte[] bytes = PayloadHelper.EncodeFloat(payload); result.SetData(bytes); return result; }
public override Payload Encode(char[] buffer, int offset, int length) { Payload result = new Payload(); int payload = ArrayUtil.ParseInt(buffer, offset, length);//TODO: improve this so that we don't have to new Strings byte[] bytes = PayloadHelper.EncodeInt(payload); result.SetData(bytes); return result; }