Back to project page bitcoin-wallet.
The source code is released under:
Copyright (C) 2011 by Caleb Anderson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the ...
If you think the Android project bitcoin-wallet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.dirtyfilthy.bitcoin.protocol; /*from ww w . ja v a 2 s . c o m*/ import java.io.DataInputStream; import java.io.IOException; import net.dirtyfilthy.bitcoin.core.Block; public class BlockPacket extends Packet { private Block block; public BlockPacket(long ver) { super(ver,"block"); } public BlockPacket() { super(); setCommand("block"); } public void setBlock(Block block) { this.block = block; } public Block getBlock() { return block; } public boolean includeTransactions(){ return (packetType & (SER_GETHASH|SER_BLOCKHEADERONLY))!=0; } public void readData(DataInputStream in) throws IOException{ this.block=new Block(in,includeTransactions()); } public byte[] create(){ return this.block.toByteArray(includeTransactions()); } }