public static void Encode(XdrDataOutputStream stream, Memo encodedMemo) { stream.WriteInt((int)encodedMemo.Discriminant.InnerValue); switch (encodedMemo.Discriminant.InnerValue) { case MemoType.MemoTypeEnum.MEMO_NONE: break; case MemoType.MemoTypeEnum.MEMO_TEXT: stream.WriteString(encodedMemo.Text); break; case MemoType.MemoTypeEnum.MEMO_ID: Uint64.Encode(stream, encodedMemo.Id); break; case MemoType.MemoTypeEnum.MEMO_HASH: Hash.Encode(stream, encodedMemo.Hash); break; case MemoType.MemoTypeEnum.MEMO_RETURN: Hash.Encode(stream, encodedMemo.RetHash); break; } }
public static void Encode(XdrDataOutputStream stream, Hello encodedHello) { Uint32.Encode(stream, encodedHello.LedgerVersion); Uint32.Encode(stream, encodedHello.OverlayVersion); Uint32.Encode(stream, encodedHello.OverlayMinVersion); Hash.Encode(stream, encodedHello.NetworkID); stream.WriteString(encodedHello.VersionStr); stream.WriteInt(encodedHello.ListeningPort); NodeID.Encode(stream, encodedHello.PeerID); AuthCert.Encode(stream, encodedHello.Cert); Uint256.Encode(stream, encodedHello.Nonce); }
public static void Encode(XdrDataOutputStream stream, PeerStats encodedPeerStats) { NodeID.Encode(stream, encodedPeerStats.Id); stream.WriteString(encodedPeerStats.VersionStr); Uint64.Encode(stream, encodedPeerStats.MessagesRead); Uint64.Encode(stream, encodedPeerStats.MessagesWritten); Uint64.Encode(stream, encodedPeerStats.BytesRead); Uint64.Encode(stream, encodedPeerStats.BytesWritten); Uint64.Encode(stream, encodedPeerStats.SecondsConnected); Uint64.Encode(stream, encodedPeerStats.UniqueFloodBytesRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFloodBytesRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFetchBytesRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFetchBytesRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFloodMessageRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFloodMessageRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFetchMessageRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFetchMessageRecv); }
public static void Encode(XdrDataOutputStream stream, Error encodedError) { ErrorCode.Encode(stream, encodedError.Code); stream.WriteString(encodedError.Msg); }
public static void Encode(XdrDataOutputStream stream, String32 encodedString32) { stream.WriteString(encodedString32.InnerValue); }