@Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { Utils.uint32ToByteStreamLE(itemId, stream); Utils.uint32ToByteStreamLE(count, stream); }
/** * 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); }
@Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { stream.write(hash.getReversedBytes()); Utils.uint32ToByteStreamLE(index, stream); }
/** * 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); }
@Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { stream.write(hash.getReversedBytes()); Utils.uint32ToByteStreamLE(index, stream); }
/** * 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); }
@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); }
@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); }
@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); }
@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); }
@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()); } }
@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); }
@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); }
@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); }
@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); }
@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()); } }
@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()); } }
@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); }
@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); }
@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. } }