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

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(84)

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

Utils.uint32ToByteStreamLE介绍

暂无

代码示例

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  Utils.uint32ToByteStreamLE(itemId, stream);
  Utils.uint32ToByteStreamLE(count, stream);
}

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

/**
 * Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
 */
@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(data.length).encode());
  stream.write(data);
  Utils.uint32ToByteStreamLE(hashFuncs, stream);
  Utils.uint32ToByteStreamLE(nTweak, stream);
  stream.write(nFlags);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(hash.getReversedBytes());
  Utils.uint32ToByteStreamLE(index, stream);
}

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

/**
 * Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
 */
@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(data.length).encode());
  stream.write(data);
  Utils.uint32ToByteStreamLE(hashFuncs, stream);
  Utils.uint32ToByteStreamLE(nTweak, stream);
  stream.write(nFlags);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(hash.getReversedBytes());
  Utils.uint32ToByteStreamLE(index, stream);
}

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

/**
 * Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
 */
@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(data.length).encode());
  stream.write(data);
  Utils.uint32ToByteStreamLE(hashFuncs, stream);
  Utils.uint32ToByteStreamLE(nTweak, stream);
  stream.write(nFlags);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(version, stream);
  stream.write(new VarInt(inputs.size()).encode());
  for (TransactionInput in : inputs)
    in.bitcoinSerialize(stream);
  stream.write(new VarInt(outputs.size()).encode());
  for (TransactionOutput out : outputs)
    out.bitcoinSerialize(stream);
  uint32ToByteStreamLE(lockTime, stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  outpoint.bitcoinSerialize(stream);
  stream.write(new VarInt(scriptBytes.length).encode());
  stream.write(scriptBytes);
  Utils.uint32ToByteStreamLE(sequence, stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  outpoint.bitcoinSerialize(stream);
  stream.write(new VarInt(scriptBytes.length).encode());
  stream.write(scriptBytes);
  Utils.uint32ToByteStreamLE(sequence, stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  outpoint.bitcoinSerialize(stream);
  stream.write(new VarInt(scriptBytes.length).encode());
  stream.write(scriptBytes);
  Utils.uint32ToByteStreamLE(sequence, stream);
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(items.size()).encode());
  for (InventoryItem i : items) {
    // Write out the type code.
    Utils.uint32ToByteStreamLE(i.type.code(), stream);
    // And now the hash.
    stream.write(i.hash.getReversedBytes());
  }
}

代码示例来源:origin: dogecoin/libdohj

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(hashes.size()).encode());
  for (Sha256Hash hash: hashes) {
      stream.write(Utils.reverseBytes(hash.getBytes()));
  }
  Utils.uint32ToByteStreamLE(index, stream);
}

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

@Override
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(denom, stream);
  vin.bitcoinSerialize(stream);
  int64ToByteStreamLE(time, stream);
  byte data [] = new byte[1];
  data[0] = (byte)(ready ? 1 : 0);
  stream.write(data);
  stream.write(new VarInt(vchSig.length).encode());
  stream.write(vchSig);
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(transactionCount, stream);
  stream.write(new VarInt(hashes.size()).encode());
  for (Sha256Hash hash : hashes)
    stream.write(hash.getReversedBytes());
  stream.write(new VarInt(matchedChildBits.length).encode());
  stream.write(matchedChildBits);
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(transactionCount, stream);
  stream.write(new VarInt(hashes.size()).encode());
  for (Sha256Hash hash : hashes)
    stream.write(hash.getReversedBytes());
  stream.write(new VarInt(matchedChildBits.length).encode());
  stream.write(matchedChildBits);
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(items.size()).encode());
  for (InventoryItem i : items) {
    // Write out the type code.
    Utils.uint32ToByteStreamLE(i.type.ordinal(), stream);
    // And now the hash.
    stream.write(i.hash.getReversedBytes());
  }
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  stream.write(new VarInt(items.size()).encode());
  for (InventoryItem i : items) {
    // Write out the type code.
    Utils.uint32ToByteStreamLE(i.type.code(), stream);
    // And now the hash.
    stream.write(i.hash.getReversedBytes());
  }
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(transactionCount, stream);
  stream.write(new VarInt(hashes.size()).encode());
  for (Sha256Hash hash : hashes)
    stream.write(hash.getReversedBytes());
  stream.write(new VarInt(matchedChildBits.length).encode());
  stream.write(matchedChildBits);
}

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

@Override
public void bitcoinSerializeToStream(OutputStream stream) throws IOException {
  uint32ToByteStreamLE(transactionCount, stream);
  stream.write(new VarInt(hashes.size()).encode());
  for (Sha256Hash hash : hashes)
    stream.write(hash.getReversedBytes());
  stream.write(new VarInt(matchedChildBits.length).encode());
  stream.write(matchedChildBits);
}

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

@Override
public Sha256Hash getHash()
{
  try {
    ByteArrayOutputStream bos = new UnsafeByteArrayOutputStream(HASH_SIZE);
    Utils.uint32ToByteStreamLE(nSporkID, bos);
    Utils.int64ToByteStreamLE(nValue, bos);
    Utils.int64ToByteStreamLE(nTimeSigned, bos);
    return Sha256Hash.wrapReversed(Sha256Hash.hashTwice(bos.toByteArray()));
  } catch (IOException e) {
    throw new RuntimeException(e); // Cannot happen.
  }
}

相关文章