本文整理汇总了C#中Org.BouncyCastle.Bcpg.BcpgOutputStream.WriteShort方法的典型用法代码示例。如果您正苦于以下问题:C# BcpgOutputStream.WriteShort方法的具体用法?C# BcpgOutputStream.WriteShort怎么用?C# BcpgOutputStream.WriteShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Org.BouncyCastle.Bcpg.BcpgOutputStream
的用法示例。
在下文中一共展示了BcpgOutputStream.WriteShort方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
internal static void Encode(
BcpgOutputStream bcpgOut,
BigInteger val)
{
bcpgOut.WriteShort((short) val.BitLength);
bcpgOut.Write(val.ToByteArrayUnsigned());
}
示例2: EncodeLengthAndData
private static void EncodeLengthAndData(
BcpgOutputStream pOut,
byte[] data)
{
pOut.WriteShort((short) data.Length);
pOut.Write(data);
}
示例3: GetEncodedContents
public byte[] GetEncodedContents()
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WriteByte((byte) version);
pOut.WriteInt((int) time);
if (version <= 3)
{
pOut.WriteShort((short) validDays);
}
pOut.WriteByte((byte) algorithm);
pOut.WriteObject((BcpgObject)key);
return bOut.ToArray();
}
示例4: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WriteShort((short) val.BitLength);
bcpgOut.Write(val.ToByteArrayUnsigned());
}
示例5: GetEncodedContents
/// <summary>
/// Gets the encoded contents.
/// </summary>
/// <returns></returns>
public byte[] GetEncodedContents()
{
using (var bOut = new MemoryStream())
{
using (var pOut = new BcpgOutputStream(bOut))
{
pOut.WriteByte((byte)_version);
pOut.WriteInt((int)_time);
if (_version <= 3)
{
pOut.WriteShort((short)_validDays);
}
pOut.WriteByte((byte)_algorithm);
pOut.WriteObject((BcpgObject)_key);
return bOut.ToArray();
}
}
}