本文整理汇总了C#中IByteReader类的典型用法代码示例。如果您正苦于以下问题:C# IByteReader类的具体用法?C# IByteReader怎么用?C# IByteReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IByteReader类属于命名空间,在下文中一共展示了IByteReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decode
public static Price Decode(IByteReader stream)
{
Price decodedPrice = new Price();
decodedPrice.N = Int32.Decode(stream);
decodedPrice.D = Int32.Decode(stream);
return decodedPrice;
}
示例2: Decode
public static TransactionResultPair Decode(IByteReader stream)
{
TransactionResultPair decodedTransactionResultPair = new TransactionResultPair();
decodedTransactionResultPair.TransactionHash = Hash.Decode(stream);
decodedTransactionResultPair.Result = TransactionResult.Decode(stream);
return decodedTransactionResultPair;
}
示例3: Decode
public static Signature Decode(IByteReader stream)
{
Signature decodedSignature = new Signature();
int Signaturesize = XdrEncoding.DecodeInt32(stream);
decodedSignature.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Signaturesize);
return decodedSignature;
}
示例4: Decode
public static Thresholds Decode(IByteReader stream)
{
Thresholds decodedThresholds = new Thresholds();
int Thresholdssize = 4;
decodedThresholds.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Thresholdssize);
return decodedThresholds;
}
示例5: Decode
public static SCPStatement Decode(IByteReader stream) {
SCPStatement decodedSCPStatement = new SCPStatement();
decodedSCPStatement.NodeID = NodeID.Decode(stream);
decodedSCPStatement.SlotIndex = Uint64.Decode(stream);
decodedSCPStatement.Pledges = SCPStatementPledges.Decode(stream);
return decodedSCPStatement;
}
示例6: Decode
public static Uint256 Decode(IByteReader stream)
{
Uint256 decodedUint256 = new Uint256();
int uint256size = 32;
decodedUint256.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)uint256size);
return decodedUint256;
}
示例7: Decode
public static AuthenticatedMessageV0 Decode(IByteReader stream) {
AuthenticatedMessageV0 decodedAuthenticatedMessageV0 = new AuthenticatedMessageV0();
decodedAuthenticatedMessageV0.Sequence = Uint64.Decode(stream);
decodedAuthenticatedMessageV0.Message = StellarMessage.Decode(stream);
decodedAuthenticatedMessageV0.Mac = HmacSha256Mac.Decode(stream);
return decodedAuthenticatedMessageV0;
}
示例8: Decode
public static SignatureHint Decode(IByteReader stream)
{
SignatureHint decodedSignatureHint = new SignatureHint();
int SignatureHintsize = 4;
decodedSignatureHint.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)SignatureHintsize);
return decodedSignatureHint;
}
示例9: isFileCompliant
//public int getMaxOffset() { return MaxOffset; }
/**
* checks whether the binary file specified by targetFile is compliant
* with this byte sequence
*
* @param targetFile The binary file to be identified
*/
public bool isFileCompliant(IByteReader targetFile)
{
//System.out.println("Looking at new byte sequence with reference "+Reference);
//initialise variables and start with the file marker at the beginning of the file
bool isCompliant = true;
bool reverseOrder = (string.Compare(getReference(), "EOFoffset", true) == 0) ? true : false; //(getReference().equalsIgnoreCase("EOFoffset")) ? true : false;
int ssLoopStart = reverseOrder ? getNumSubSequences() - 1 : 0;
int ssLoopEnd = reverseOrder ? -1 : getNumSubSequences();
int searchDirection = reverseOrder ? -1 : 1;
if (reverseOrder)
{
targetFile.SetFileMarker(targetFile.GetNumberOfBytes() - 1L);
}
else
{
targetFile.SetFileMarker(0L);
}
//check whether each subsequence in turn is compliant
for (int iSS = ssLoopStart; (searchDirection * iSS < searchDirection * ssLoopEnd) & isCompliant; iSS += searchDirection)
{
bool isFixedStart = ((string.Compare(getReference(), "EOFoffset", true) == 0) || (string.Compare(getReference(), "BOFoffset", true) == 0)) ? true : false; //getReference().equalsIgnoreCase("EOFoffset") || getReference().equalsIgnoreCase("BOFoffset");
if ((iSS == ssLoopStart) && (isFixedStart))
{
isCompliant = getSubSequence(iSS).isFoundAtStartOfFile(targetFile, reverseOrder, bigEndian); //, MaxOffset);
}
else
{
isCompliant = getSubSequence(iSS).isFoundAfterFileMarker(targetFile, reverseOrder, bigEndian);
}
}
return isCompliant;
}
示例10: Decode
public static Curve25519Secret Decode(IByteReader stream)
{
Curve25519Secret decodedCurve25519Secret = new Curve25519Secret();
int keysize = 32;
decodedCurve25519Secret.Key = XdrEncoding.ReadFixOpaque(stream, (uint)keysize);
return decodedCurve25519Secret;
}
示例11: Decode
public static Value Decode(IByteReader stream)
{
Value decodedValue = new Value();
int Valuesize = XdrEncoding.DecodeInt32(stream);
decodedValue.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Valuesize);
return decodedValue;
}
示例12: Decode
public static DecoratedSignature Decode(IByteReader stream)
{
DecoratedSignature decodedDecoratedSignature = new DecoratedSignature();
decodedDecoratedSignature.Hint = SignatureHint.Decode(stream);
decodedDecoratedSignature.Signature = Signature.Decode(stream);
return decodedDecoratedSignature;
}
示例13: Decode
public static Error Decode(IByteReader stream)
{
Error decodedError = new Error();
decodedError.Code = ErrorCode.Decode(stream);
decodedError.Msg = XdrEncoding.ReadString(stream);
return decodedError;
}
示例14: Decode
public static PaymentOp Decode(IByteReader stream) {
PaymentOp decodedPaymentOp = new PaymentOp();
decodedPaymentOp.Destination = AccountID.Decode(stream);
decodedPaymentOp.Asset = Asset.Decode(stream);
decodedPaymentOp.Amount = Int64.Decode(stream);
return decodedPaymentOp;
}
示例15: Decode
public static LedgerEntry Decode(IByteReader stream) {
LedgerEntry decodedLedgerEntry = new LedgerEntry();
decodedLedgerEntry.LastModifiedLedgerSeq = Uint32.Decode(stream);
decodedLedgerEntry.Data = LedgerEntryData.Decode(stream);
decodedLedgerEntry.Ext = LedgerEntryExt.Decode(stream);
return decodedLedgerEntry;
}