LedgerWallet.BufferUtils.WriteBuffer C# (CSharp) Method

WriteBuffer() static private method

static private WriteBuffer ( System data, IBitcoinSerializable serializable ) : void
data System
serializable IBitcoinSerializable
return void
        internal static void WriteBuffer(System.IO.Stream data, IBitcoinSerializable serializable)
        {
            WriteBuffer(data, serializable.ToBytes());
        }

Same methods

BufferUtils::WriteBuffer ( System data, byte buffer ) : void
BufferUtils::WriteBuffer ( System data, uint value ) : void

Usage Example

        public byte[] UntrustedHashSign(KeyPath keyPath, UserPin pin, LockTime lockTime, SigHash sigHashType)
        {
            MemoryStream data = new MemoryStream();

            byte[] path = Serializer.Serialize(keyPath);
            BufferUtils.WriteBuffer(data, path);

            var pinBytes = pin == null ? new byte[0] : pin.ToBytes();

            data.WriteByte((byte)pinBytes.Length);
            BufferUtils.WriteBuffer(data, pinBytes);
            BufferUtils.WriteUint32BE(data, (uint)lockTime);
            data.WriteByte((byte)sigHashType);
            return(CreateAPDU(LedgerWalletConstants.LedgerWallet_CLA, LedgerWalletConstants.LedgerWallet_INS_HASH_SIGN, (byte)0x00, (byte)0x00, data.ToArray()));
        }
All Usage Examples Of LedgerWallet.BufferUtils::WriteBuffer