public byte[] WriteOpToByte(WriteOpLCS source) { switch (source.WriteOpType) { case WriteOpType.Value: var type = U32ToByte((uint)source.WriteOpType); var data = LCSCore.LCSDeserialization(source.Value); return(type.Concat(data).ToArray()); default: return(U32ToByte((uint)source.WriteOpType)); } }
public WriteOpLCS GetWriteOp(byte[] source, ref int cursor) { var retVal = new WriteOpLCS(); retVal.WriteOpType = (WriteOpType)source.LCSerialization <uint>(ref cursor); if (retVal.WriteOpType == WriteOpType.Value) { retVal.Value = source.LCSerialization <byte[]>(ref cursor); } return(retVal); }