WriteShort() private méthode

private WriteShort ( short n ) : void
n short
Résultat void
Exemple #1
0
 private static void EncodeLengthAndData(
     BcpgOutputStream pOut,
     byte[]                          data)
 {
     pOut.WriteShort((short)data.Length);
     pOut.Write(data);
 }
Exemple #2
0
 internal static void Encode(
     BcpgOutputStream bcpgOut,
     BigInteger val)
 {
     bcpgOut.WriteShort((short)val.BitLength);
     bcpgOut.Write(val.ToByteArrayUnsigned());
 }
		internal static void Encode(
			BcpgOutputStream	bcpgOut,
			BigInteger			val)
		{
			bcpgOut.WriteShort((short) val.BitLength);
			bcpgOut.Write(val.ToByteArrayUnsigned());
		}
        public virtual byte[] GetEncodedContents()
        {
            MemoryStream     memoryStream     = new MemoryStream();
            BcpgOutputStream bcpgOutputStream = new BcpgOutputStream(memoryStream);

            bcpgOutputStream.WriteByte((byte)this.version);
            bcpgOutputStream.WriteInt((int)this.time);
            if (this.version <= 3)
            {
                bcpgOutputStream.WriteShort((short)this.validDays);
            }
            bcpgOutputStream.WriteByte((byte)this.algorithm);
            bcpgOutputStream.WriteObject((BcpgObject)this.key);
            return(memoryStream.ToArray());
        }
        public virtual byte[] GetEncodedContents()
        {
            //IL_0000: Unknown result type (might be due to invalid IL or missing references)
            //IL_0006: Expected O, but got Unknown
            MemoryStream     val = new MemoryStream();
            BcpgOutputStream bcpgOutputStream = new BcpgOutputStream((Stream)(object)val);

            ((Stream)bcpgOutputStream).WriteByte((byte)version);
            bcpgOutputStream.WriteInt((int)time);
            if (version <= 3)
            {
                bcpgOutputStream.WriteShort((short)validDays);
            }
            ((Stream)bcpgOutputStream).WriteByte((byte)algorithm);
            bcpgOutputStream.WriteObject((BcpgObject)key);
            return(val.ToArray());
        }
        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());
        }
        /// <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());
                }
            }
        }
Exemple #8
0
 public override void Encode(BcpgOutputStream bcpgOut)
 {
     bcpgOut.WriteShort((short)this.val.BitLength);
     bcpgOut.Write(this.val.ToByteArrayUnsigned());
 }
		private static void EncodeLengthAndData(
			BcpgOutputStream	pOut,
			byte[]				data)
		{
			pOut.WriteShort((short) data.Length);
			pOut.Write(data);
		}
Exemple #10
0
        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();
        }
Exemple #11
0
        public override void Encode(
            BcpgOutputStream bcpgOut)
        {
			bcpgOut.WriteShort((short) val.BitLength);
			bcpgOut.Write(val.ToByteArrayUnsigned());
        }
        /// <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();
                }
            }
        }