org.bitcoinj.core.Block.writeTransactions()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(82)

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

Block.writeTransactions介绍

暂无

代码示例

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  writeHeader(stream);
  // We may only have enough data to write the header.
  writeTransactions(stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  writeHeader(stream);
  // We may only have enough data to write the header.
  writeTransactions(stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  writeHeader(stream);
  // We may only have enough data to write the header.
  writeTransactions(stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  writeHeader(stream);
  // We may only have enough data to write the header.
  writeTransactions(stream);
}

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

try {
  writeHeader(stream);
  writeTransactions(stream);
} catch (IOException e) {

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

/**
 * Special handling to check if we have a valid byte array for both header
 * and transactions
 */
@Override
public byte[] bitcoinSerialize() {
  // we have completely cached byte array.
  if (headerBytesValid && transactionBytesValid) {
    Preconditions.checkNotNull(payload, "Bytes should never be null if headerBytesValid && transactionBytesValid");
    if (length == payload.length) {
      return payload;
    } else {
      // byte array is offset so copy out the correct range.
      byte[] buf = new byte[length];
      System.arraycopy(payload, offset, buf, 0, length);
      return buf;
    }
  }
  // At least one of the two cacheable components is invalid
  // so fall back to stream write since we can't be sure of the length.
  ByteArrayOutputStream stream = new UnsafeByteArrayOutputStream(length == UNKNOWN_LENGTH ? HEADER_SIZE + guessTransactionsLength() : length);
  try {
    writeHeader(stream);
    writeTransactions(stream);
  } catch (IOException e) {
    // Cannot happen, we are serializing to a memory stream.
  }
  return stream.toByteArray();
}

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

try {
  writeHeader(stream);
  writeTransactions(stream);
} catch (IOException e) {

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

try {
  writeHeader(stream);
  writeTransactions(stream);
} catch (IOException e) {

相关文章

微信公众号

最新文章

更多