SetData() public method

Gets or sets a reference to the underlying byte array that holds this payloads data. Data is not copied.
public SetData ( byte value ) : void
value byte
return void
Example #1
0
 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;
 }
Example #2
0
 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;
 }