gpt4 book ai didi

org.bitcoinj.wallet.WalletProtobufSerializer.writeWallet()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 22:33:05 27 4
gpt4 key购买 nike

本文整理了Java中org.bitcoinj.wallet.WalletProtobufSerializer.writeWallet()方法的一些代码示例,展示了WalletProtobufSerializer.writeWallet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalletProtobufSerializer.writeWallet()方法的具体详情如下:
包路径:org.bitcoinj.wallet.WalletProtobufSerializer
类名称:WalletProtobufSerializer
方法名:writeWallet

WalletProtobufSerializer.writeWallet介绍

[英]Formats the given wallet (transactions and keys) to the given output stream in protocol buffer format.

Equivalent to walletToProto(wallet).writeTo(output);
[中]将给定钱包(交易和密钥)格式化为协议缓冲区格式的给定输出流。
相当于walletToProto(钱包)。写入(输出);

代码示例

代码示例来源:origin: greenaddress/GreenBits

/**
 * Uses protobuf serialization to save the wallet to the given file stream. To learn more about this file format, see
 * {@link WalletProtobufSerializer}.
 */
public void saveToFileStream(OutputStream f) throws IOException {
  lock.lock();
  try {
    new WalletProtobufSerializer().writeWallet(this, f);
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: fr.acinq/bitcoinj-core

/**
 * Uses protobuf serialization to save the wallet to the given file stream. To learn more about this file format, see
 * {@link WalletProtobufSerializer}.
 */
public void saveToFileStream(OutputStream f) throws IOException {
  lock.lock();
  try {
    new WalletProtobufSerializer().writeWallet(this, f);
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

/**
 * Uses protobuf serialization to save the wallet to the given file stream. To learn more about this file format, see
 * {@link WalletProtobufSerializer}.
 */
public void saveToFileStream(OutputStream f) throws IOException {
  lock.lock();
  try {
    new WalletProtobufSerializer().writeWallet(this, f);
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: HashEngineering/dashj

/**
 * Uses protobuf serialization to save the wallet to the given file stream. To learn more about this file format, see
 * {@link WalletProtobufSerializer}.
 */
public void saveToFileStream(OutputStream f) throws IOException {
  lock.lock();
  try {
    new WalletProtobufSerializer().writeWallet(this, f);
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: greenaddress/GreenBits

private static Wallet roundTrip(Wallet wallet) throws Exception {
  ByteArrayOutputStream output = new ByteArrayOutputStream();
  new WalletProtobufSerializer().writeWallet(wallet, output);
  ByteArrayInputStream test = new ByteArrayInputStream(output.toByteArray());
  assertTrue(WalletProtobufSerializer.isWallet(test));
  ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray());
  return new WalletProtobufSerializer().readWallet(input);
}

代码示例来源:origin: greenaddress/GreenBits

private static Wallet roundTripClientWallet(Wallet wallet) throws Exception {
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  new WalletProtobufSerializer().writeWallet(wallet, bos);
  org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
  StoredPaymentChannelClientStates state = new StoredPaymentChannelClientStates(null, failBroadcaster);
  return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}

代码示例来源:origin: greenaddress/GreenBits

private static Wallet roundTripServerWallet(Wallet wallet) throws Exception {
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  new WalletProtobufSerializer().writeWallet(wallet, bos);
  StoredPaymentChannelServerStates state = new StoredPaymentChannelServerStates(null, failBroadcaster);
  org.bitcoinj.wallet.Protos.Wallet proto = WalletProtobufSerializer.parseToProto(new ByteArrayInputStream(bos.toByteArray()));
  return new WalletProtobufSerializer().readWallet(wallet.getParams(), new WalletExtension[] { state }, proto);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com