test_class.declarator: addrMessage = Hex.decode("f9beb4d96164647200000000000000001f000000" +
              "ed52399b01e215104d010000000000000000000000000000000000ffff0a000001208d")
test_class.modifier: private final
test_class.original_string: private final byte[] addrMessage = Hex.decode("f9beb4d96164647200000000000000001f000000" +
              "ed52399b01e215104d010000000000000000000000000000000000ffff0a000001208d");
test_class.type: byte[]
test_class.var_name: addrMessage
test_class.declarator: txMessage = Hex.decode(
              "F9 BE B4 D9 74 78 00 00  00 00 00 00 00 00 00 00" +
              "02 01 00 00 E2 93 CD BE  01 00 00 00 01 6D BD DB" +
              "08 5B 1D 8A F7 51 84 F0  BC 01 FA D5 8D 12 66 E9" +
              "B6 3B 50 88 19 90 E4 B4  0D 6A EE 36 29 00 00 00" +
              "00 8B 48 30 45 02 21 00  F3 58 1E 19 72 AE 8A C7" +
              "C7 36 7A 7A 25 3B C1 13  52 23 AD B9 A4 68 BB 3A" +
              "59 23 3F 45 BC 57 83 80  02 20 59 AF 01 CA 17 D0" +
              "0E 41 83 7A 1D 58 E9 7A  A3 1B AE 58 4E DE C2 8D" +
              "35 BD 96 92 36 90 91 3B  AE 9A 01 41 04 9C 02 BF" +
              "C9 7E F2 36 CE 6D 8F E5  D9 40 13 C7 21 E9 15 98" +
              "2A CD 2B 12 B6 5D 9B 7D  59 E2 0A 84 20 05 F8 FC" +
              "4E 02 53 2E 87 3D 37 B9  6F 09 D6 D4 51 1A DA 8F" +
              "14 04 2F 46 61 4A 4C 70  C0 F1 4B EF F5 FF FF FF" +
              "FF 02 40 4B 4C 00 00 00  00 00 19 76 A9 14 1A A0" +
              "CD 1C BE A6 E7 45 8A 7A  BA D5 12 A9 D9 EA 1A FB" +
              "22 5E 88 AC 80 FA E9 C7  00 00 00 00 19 76 A9 14" +
              "0E AB 5B EA 43 6A 04 84  CF AB 12 48 5E FD A0 B7" +
              "8B 4E CC 52 88 AC 00 00  00 00")
test_class.modifier: private final
test_class.original_string: private final byte[] txMessage = Hex.decode(
              "F9 BE B4 D9 74 78 00 00  00 00 00 00 00 00 00 00" +
              "02 01 00 00 E2 93 CD BE  01 00 00 00 01 6D BD DB" +
              "08 5B 1D 8A F7 51 84 F0  BC 01 FA D5 8D 12 66 E9" +
              "B6 3B 50 88 19 90 E4 B4  0D 6A EE 36 29 00 00 00" +
              "00 8B 48 30 45 02 21 00  F3 58 1E 19 72 AE 8A C7" +
              "C7 36 7A 7A 25 3B C1 13  52 23 AD B9 A4 68 BB 3A" +
              "59 23 3F 45 BC 57 83 80  02 20 59 AF 01 CA 17 D0" +
              "0E 41 83 7A 1D 58 E9 7A  A3 1B AE 58 4E DE C2 8D" +
              "35 BD 96 92 36 90 91 3B  AE 9A 01 41 04 9C 02 BF" +
              "C9 7E F2 36 CE 6D 8F E5  D9 40 13 C7 21 E9 15 98" +
              "2A CD 2B 12 B6 5D 9B 7D  59 E2 0A 84 20 05 F8 FC" +
              "4E 02 53 2E 87 3D 37 B9  6F 09 D6 D4 51 1A DA 8F" +
              "14 04 2F 46 61 4A 4C 70  C0 F1 4B EF F5 FF FF FF" +
              "FF 02 40 4B 4C 00 00 00  00 00 19 76 A9 14 1A A0" +
              "CD 1C BE A6 E7 45 8A 7A  BA D5 12 A9 D9 EA 1A FB" +
              "22 5E 88 AC 80 FA E9 C7  00 00 00 00 19 76 A9 14" +
              "0E AB 5B EA 43 6A 04 84  CF AB 12 48 5E FD A0 B7" +
              "8B 4E CC 52 88 AC 00 00  00 00");
test_class.type: byte[]
test_class.var_name: txMessage
test_class.file: core/src/test/java/com/google/bitcoin/core/BitcoinSerializerTest.java
test_class.identifier: BitcoinSerializerTest
test_case.body: @Test
      public void testHeaders1() throws Exception {
          BitcoinSerializer bs = new BitcoinSerializer(MainNetParams.get());
  
          HeadersMessage hm = (HeadersMessage) bs.deserialize(ByteBuffer.wrap(Hex.decode("f9beb4d9686561" +
                  "646572730000000000520000005d4fab8101010000006fe28c0ab6f1b372c1a6a246ae6" +
                  "3f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677b" +
                  "a1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e3629900")));
  
          // The first block after the genesis
          // http://blockexplorer.com/b/1
          Block block = hm.getBlockHeaders().get(0);
          String hash = block.getHashAsString();
          assertEquals(hash, "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048");
  
          assertNull(block.transactions);
  
          assertEquals(Utils.bytesToHexString(block.getMerkleRoot().getBytes()),
                  "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098");
      }
test_case.class_method_signature: BitcoinSerializerTest.testHeaders1()
test_case.full_signature: @Test public void testHeaders1()
test_case.identifier: testHeaders1
test_case.invocations: get deserialize wrap decode get getBlockHeaders getHashAsString assertEquals assertNull assertEquals bytesToHexString getBytes getMerkleRoot
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testHeaders1()
focal_class.declarator: log = LoggerFactory.getLogger(BitcoinSerializer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(BitcoinSerializer.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: COMMAND_LEN = 12
focal_class.modifier: private static final
focal_class.original_string: private static final int COMMAND_LEN = 12;
focal_class.type: int
focal_class.var_name: COMMAND_LEN
focal_class.declarator: params
focal_class.modifier: private
focal_class.original_string: private NetworkParameters params;
focal_class.type: NetworkParameters
focal_class.var_name: params
focal_class.declarator: parseLazy = false
focal_class.modifier: private
focal_class.original_string: private boolean parseLazy = false;
focal_class.type: boolean
focal_class.var_name: parseLazy
focal_class.declarator: parseRetain = false
focal_class.modifier: private
focal_class.original_string: private boolean parseRetain = false;
focal_class.type: boolean
focal_class.var_name: parseRetain
focal_class.declarator: names = new HashMap<Class<? extends Message>, String>()
focal_class.modifier: private static
focal_class.original_string: private static Map<Class<? extends Message>, String> names = new HashMap<Class<? extends Message>, String>();
focal_class.type: Map<Class<? extends Message>, String>
focal_class.var_name: names
focal_class.file: core/src/main/java/com/google/bitcoin/core/BitcoinSerializer.java
focal_class.identifier: BitcoinSerializer
focal_class.class_method_signature: BitcoinSerializer.BitcoinSerializer(NetworkParameters params)
focal_class.full_signature: public  BitcoinSerializer(NetworkParameters params)
focal_class.identifier: BitcoinSerializer
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params)
focal_class.signature:  BitcoinSerializer(NetworkParameters params)
focal_class.class_method_signature: BitcoinSerializer.BitcoinSerializer(NetworkParameters params, boolean parseLazy, boolean parseRetain)
focal_class.full_signature: public  BitcoinSerializer(NetworkParameters params, boolean parseLazy, boolean parseRetain)
focal_class.identifier: BitcoinSerializer
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, boolean parseLazy, boolean parseRetain)
focal_class.signature:  BitcoinSerializer(NetworkParameters params, boolean parseLazy, boolean parseRetain)
focal_class.class_method_signature: BitcoinSerializer.serialize(String name, byte[] message, OutputStream out)
focal_class.full_signature: public void serialize(String name, byte[] message, OutputStream out)
focal_class.identifier: serialize
focal_class.modifiers: public
focal_class.parameters: (String name, byte[] message, OutputStream out)
focal_class.return: void
focal_class.signature: void serialize(String name, byte[] message, OutputStream out)
focal_class.class_method_signature: BitcoinSerializer.serialize(Message message, OutputStream out)
focal_class.full_signature: public void serialize(Message message, OutputStream out)
focal_class.identifier: serialize
focal_class.modifiers: public
focal_class.parameters: (Message message, OutputStream out)
focal_class.return: void
focal_class.signature: void serialize(Message message, OutputStream out)
focal_class.class_method_signature: BitcoinSerializer.deserialize(ByteBuffer in)
focal_class.full_signature: public Message deserialize(ByteBuffer in)
focal_class.identifier: deserialize
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer in)
focal_class.return: Message
focal_class.signature: Message deserialize(ByteBuffer in)
focal_class.class_method_signature: BitcoinSerializer.deserializeHeader(ByteBuffer in)
focal_class.full_signature: public BitcoinPacketHeader deserializeHeader(ByteBuffer in)
focal_class.identifier: deserializeHeader
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer in)
focal_class.return: BitcoinPacketHeader
focal_class.signature: BitcoinPacketHeader deserializeHeader(ByteBuffer in)
focal_class.class_method_signature: BitcoinSerializer.deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.full_signature: public Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.identifier: deserializePayload
focal_class.modifiers: public
focal_class.parameters: (BitcoinPacketHeader header, ByteBuffer in)
focal_class.return: Message
focal_class.signature: Message deserializePayload(BitcoinPacketHeader header, ByteBuffer in)
focal_class.class_method_signature: BitcoinSerializer.makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.full_signature: private Message makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.identifier: makeMessage
focal_class.modifiers: private
focal_class.parameters: (String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.return: Message
focal_class.signature: Message makeMessage(String command, int length, byte[] payloadBytes, byte[] hash, byte[] checksum)
focal_class.class_method_signature: BitcoinSerializer.seekPastMagicBytes(ByteBuffer in)
focal_class.full_signature: public void seekPastMagicBytes(ByteBuffer in)
focal_class.identifier: seekPastMagicBytes
focal_class.modifiers: public
focal_class.parameters: (ByteBuffer in)
focal_class.return: void
focal_class.signature: void seekPastMagicBytes(ByteBuffer in)
focal_class.class_method_signature: BitcoinSerializer.isParseLazyMode()
focal_class.full_signature: public boolean isParseLazyMode()
focal_class.identifier: isParseLazyMode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isParseLazyMode()
focal_class.class_method_signature: BitcoinSerializer.isParseRetainMode()
focal_class.full_signature: public boolean isParseRetainMode()
focal_class.identifier: isParseRetainMode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isParseRetainMode()
focal_method.body: public Message deserialize(ByteBuffer in) throws ProtocolException, IOException {
          // A Bitcoin protocol message has the following format.
          //
          //   - 4 byte magic number: 0xfabfb5da for the testnet or
          //                          0xf9beb4d9 for production
          //   - 12 byte command in ASCII
          //   - 4 byte payload size
          //   - 4 byte checksum
          //   - Payload data
          //
          // The checksum is the first 4 bytes of a SHA256 hash of the message payload. It isn't
          // present for all messages, notably, the first one on a connection.
          //
          // Satoshi's implementation ignores garbage before the magic header bytes. We have to do the same because
          // sometimes it sends us stuff that isn't part of any message.
          seekPastMagicBytes(in);
          BitcoinPacketHeader header = new BitcoinPacketHeader(in);
          // Now try to read the whole message.
          return deserializePayload(header, in);
      }
focal_method.class_method_signature: BitcoinSerializer.deserialize(ByteBuffer in)
focal_method.full_signature: public Message deserialize(ByteBuffer in)
focal_method.identifier: deserialize
focal_method.invocations: seekPastMagicBytes deserializePayload
focal_method.modifiers: public
focal_method.parameters: (ByteBuffer in)
focal_method.return: Message
focal_method.signature: Message deserialize(ByteBuffer in)