gpt4 book ai didi

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

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

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

WalletProtobufSerializer.parseToProto介绍

[英]Returns the loaded protocol buffer from the given byte stream. You normally want Wallet#loadFromFile(java.io.File,WalletExtension...) instead - this method is designed for low level work involving the wallet file format itself.
[中]从给定字节流返回加载的协议缓冲区。你通常想要钱包#loadFromFile(java.io.File,WalletExtension…)相反,这种方法是为涉及钱包文件格式本身的低级工作而设计的。

代码示例

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

private Wallet loadWallet(boolean shouldReplayWallet) throws Exception {
  Wallet wallet;
  FileInputStream walletStream = new FileInputStream(vWalletFile);
  try {
    List<WalletExtension> extensions = provideWalletExtensions();
    WalletExtension[] extArray = extensions.toArray(new WalletExtension[extensions.size()]);
    Protos.Wallet proto = WalletProtobufSerializer.parseToProto(walletStream);
    final WalletProtobufSerializer serializer;
    if (walletFactory != null)
      serializer = new WalletProtobufSerializer(walletFactory);
    else
      serializer = new WalletProtobufSerializer();
    wallet = serializer.readWallet(params, extArray, proto);
    if (shouldReplayWallet)
      wallet.reset();
  } finally {
    walletStream.close();
  }
  return wallet;
}

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

private Wallet loadWallet(boolean shouldReplayWallet) throws Exception {
  Wallet wallet;
  FileInputStream walletStream = new FileInputStream(vWalletFile);
  try {
    List<WalletExtension> extensions = provideWalletExtensions();
    WalletExtension[] extArray = extensions.toArray(new WalletExtension[extensions.size()]);
    Protos.Wallet proto = WalletProtobufSerializer.parseToProto(walletStream);
    final WalletProtobufSerializer serializer;
    if (walletFactory != null)
      serializer = new WalletProtobufSerializer(walletFactory);
    else
      serializer = new WalletProtobufSerializer();
    wallet = serializer.readWallet(params, extArray, proto);
    if (shouldReplayWallet)
      wallet.reset();
  } finally {
    walletStream.close();
  }
  return wallet;
}

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

private Wallet loadWallet(boolean shouldReplayWallet) throws Exception {
  Wallet wallet;
  FileInputStream walletStream = new FileInputStream(vWalletFile);
  try {
    List<WalletExtension> extensions = provideWalletExtensions();
    WalletExtension[] extArray = extensions.toArray(new WalletExtension[extensions.size()]);
    Protos.Wallet proto = WalletProtobufSerializer.parseToProto(walletStream);
    final WalletProtobufSerializer serializer;
    if (walletFactory != null)
      serializer = new WalletProtobufSerializer(walletFactory);
    else
      serializer = new WalletProtobufSerializer();
    wallet = serializer.readWallet(params, extArray, proto);
    if (shouldReplayWallet)
      wallet.reset();
  } finally {
    walletStream.close();
  }
  return wallet;
}

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

private Wallet loadWallet(boolean shouldReplayWallet) throws Exception {
  Wallet wallet;
  FileInputStream walletStream = new FileInputStream(vWalletFile);
  try {
    List<WalletExtension> extensions = provideWalletExtensions();
    WalletExtension[] extArray = extensions.toArray(new WalletExtension[extensions.size()]);
    Protos.Wallet proto = WalletProtobufSerializer.parseToProto(walletStream);
    final WalletProtobufSerializer serializer;
    if (walletFactory != null)
      serializer = new WalletProtobufSerializer(walletFactory);
    else
      serializer = new WalletProtobufSerializer();
    wallet = serializer.readWallet(params, extArray, proto);
    if (shouldReplayWallet)
      wallet.reset();
  } finally {
    walletStream.close();
  }
  return wallet;
}

代码示例来源: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);
}

代码示例来源: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: fr.acinq/bitcoinj-core

Protos.Wallet walletProto = parseToProto(input);
final String paramsID = walletProto.getNetworkIdentifier();
NetworkParameters params = NetworkParameters.fromID(paramsID);

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

Protos.Wallet walletProto = parseToProto(input);
final String paramsID = walletProto.getNetworkIdentifier();
NetworkParameters params = NetworkParameters.fromID(paramsID);

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

Protos.Wallet walletProto = parseToProto(input);
final String paramsID = walletProto.getNetworkIdentifier();
NetworkParameters params = NetworkParameters.fromID(paramsID);

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

Protos.Wallet walletProto = parseToProto(input);
final String paramsID = walletProto.getNetworkIdentifier();
NetworkParameters params = NetworkParameters.fromID(paramsID);

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

Protos.Wallet proto = WalletProtobufSerializer.parseToProto(stream);
proto = attemptHexConversion(proto);
System.out.println(proto.toString());

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